Open link in a different panel - c#

I have a page that dynamically generated a list of links to a web page (aspx) that opens an image. I do not have direct access to the PDF, only through the ASPX. The code behind is C#.
So if I have a page that has codes that looks like this
<table>
<tr>
<td>
<asp:Panel ID="pnlImageList" runat="server" Visible="true" HorizontalAlign="Center" >
<a href="http://someserver.com/EDocs/View.aspx?application=MB&seqnum=260">
View Scan # 1</a>
</asp:Panel>
</td>
<td>Open Image here</td>
</tr>
</table>
How do I open the view.aspx link in the cell labels 'Open Image Here'??
AHIA,
LarryR...

Use an embedded iframe as shown here:
http://pxd.me/dompdf/www/examples.php
This is essentially doing what you want -- clicking a link (click on any of the "HTML" or "PDF" links) brings up a file in the embedded iframe.

Related

Image is not showing up.Is it a path problem?

.aspx
<tr>
<th><asp:Label runat="server" ID="_imageName" Text="이미지"></asp:Label></th>
<td>
<asp:Image ID="_image" runat="server" Height="190px" Width="360px" />
</td>
</tr>
.aspx.cs
_image.ImageUrl = "D:\SVN\Project\ImageFiles\10238\imagetest2.jpg";
Image is not showing up.
Is it a path problem?
The image file is definitely in that folder.
try this :
_image.ImageUrl = "~/ImagesFiles/10238/imagetest2.jpg";
Or directly in your HTML :
<td>
<asp:Image ID="_image" runat="server" Height="190px" Width="360px" ImageUrl="~/ImagesFiles/10238/imagetest2.jpg" />
</td>
see documentation here
The client page isn't accessing the file. It's just setting the file's path to the HTML output for the client (web browser) to access it. Resulting in this:
<img src = "D:\SVN\Project\ImageFiles\10238\imagetest2.jpg" />
Since the user doesn't have access to that file(img) (because it is available for localhost, you must serve this file(img)), the img tag won't work.

Tag a link attribute data-image can't display value c#

I want using gallery thumbnail css and js from bootstrap snippet Easy image gallery in modal. When I'm using control from c# it's cannot display.
<asp:HyperLink runat="server" class="thumbnail" href="#" data-image-id="" data-toogle="modal" data-image='<%# Eval("Image") %>' data-target="#image-gallery">
<dx:ASPxBinaryImage runat="server" class="img-responsive" ID="img" Eval='<%# Eval("Image")%>' Height="150px" Width="150px"></dx:ASPxBinaryImage>
</asp:HyperLink>
My data-image tag a link don't same show like src from tag img. A data-image value System.Byte[]
This make my modal show picture cannot display

How to use table instead of gridview?

I dont know if the my question is good or bad or duplicate but I really want to ask you a favor.
My designer gave me grid design using html tables which looks quite handsome but when I use the same css classes in asp gridview it totally looks different.
Additional Info: In my project I have used Telerik grids. I have tried applying all the css at that too but of no use.
I cant change the designer css because its for all our company.
Now at last I want to use the same table as designer gave me and use it as grid but i really dont know how to fill it from datatable?
1. GridView generates/renders code in which it is difficult to impossible to modify.
2. I would stay away from Telerik as well.
3. Use Bootstrap CSS, you should be very happy with bootstrap css framework as you will get that look above very easily.
With Bootstrap you would use classes like class=table table-striped and you effectively have a nice grid with alternating row colors just like I see in the image that you posted.
With ASP.NET , use Nuget and install Bootstrap. Reference in Masterpage or layout.
I assume that you have styles that overwrite what your designer gave to you. Perhaps also if you are using THEIR stylesheets, make sure to overwrite the default styles. Either OMIT the style reference in master page etc... or place their stylesheet references below the default in say a asp.net web forms or mvc application. ( I assume web forms with masterpage since you are saying Gridview).
You can use ListView to include components. here is the example code for ListView.
<asp:ListView ID="ListView1" GroupPlaceholderID="group" GroupItemCount="1" ItemPlaceholderID="item" runat="server">
<LayoutTemplate>
<table>
<asp:PlaceHolder runat="server" ID="group"></asp:PlaceHolder>
</table>
</LayoutTemplate>
<GroupTemplate>
<tr>
<asp:PlaceHolder runat="server" ID="item"></asp:PlaceHolder>
</tr>
</GroupTemplate>
<ItemTemplate>
<td>
<table cellpadding="2" cellspacing="0" border="1" style="width: 200px; height: 100px">
<tr>
<td>
<span>
<%# Eval("Id") %>
</span>
</td>
</tr>
<tr>
<td>
Name: <span><%# Eval("Field_name_of_your_DB") %></span><br />
Number: <span><%# Eval("Field_name_of_your_DB") %></span><br />
Date: <span><%# Eval("Field_name_of_your_DB", "{0:MM dd, yyyy}") %></span><br />
Comment: <span><%# Eval("Field_name_of_your_DB") %></span><br />
</td>
</tr>
</table>
</td>
</ItemTemplate>
</asp:ListView>

Add control from content page in master page

I have a master page that looks something like this:
<table>
<tr>
<td>
<asp:Label ID="lbl1" runat="server"></asp:Label>
</td>
<td>
<asp:Label ID="lbl2" runat="server"></asp:Label>
</td>
</tr>
</table>
I use this design in all pages except one where i would like to add a button right after the first label - lbl1 (both of them to be on same row), and on the second row to see the second label.
My question is how could I achieve this from a content page (from code-behind preferable)?
Create <asp:Button runat="server" Visible="false" ... /> which by default have Visible = false. In the page which you want to see the button find the button and make it Visible = true.
When the Control is not visible it is not render, this is equal to not existing for other pages !

Changing columns in display based on variable

I currently have a table with a repeater that is being filled with data
<table width="100%" >
<tr>
<td class="add_border_bold" nowrap>Title</a></td>
<td class="add_border_bold" nowrap>User</td>
</tr>
<asp:Repeater id="program_list" OnItemDataBound="Repeater1_ItemDataBound" runat="server">
<ItemTemplate>
<tr>
<td class="add_border">
<%# Eval("short_title") %>
</td>
<td class="add_border">
<%# Eval("userid") %>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
I'm currently converting this from coldfusion. In the previous application, I had multiple table layouts for displaying different kinds of information, for example, phone number instead of userid. (although, working with a lot more columns, I shortened it for posting). In coldfusion I would just wrap each table in a <cfif> tag controlled by a variable that said which view to use. I am unaware how to get multiple data displays into a single page controlled by a variable, like I was before. Mostly because, it appears that most of my logic is done in the code behind files, so I don't understand how to get those changes across in the .aspx, or how to manipulate them from the code behind file.
Thanks in advance.
I would utilize a MultiView control and determine which view to show from code-behind.

Categories

Resources