Click here to Skip to main content
15,893,266 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want display image using web user control in my web page.

I designed one web user control that contains one datagrid view and one template field image control.
I want to select image source into sql server table that contains image path field but image doesn't display in image control.

How can I complete this task?
Posted
Updated 23-Mar-11 6:19am
v2
Comments
Sandeep Mewara 23-Mar-11 12:19pm    
Did you try anything? Started? any effort?
Patel Nikunj B 23-Mar-11 12:21pm    
ya
Patel Nikunj B 23-Mar-11 12:22pm    
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Post.ascx.cs" Inherits="Post" %>

<style type="text/css">
.style1
{
height: 23px;
}
.style3
{
height: 23px;
font-size: small;
}
</style>

<body style="font-family: Tahoma">

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
Height="16px" Width="543px" DataSourceID="SqlDataSource1"
style="margin-top: 0px" onload="Page_Load" Caption="Posts">
<columns>
<asp:TemplateField>
<itemtemplate>
<table>
<tr><td>
<asp:Image ID="Image1" runat="server" Height="84px" AlternateText="Loading..."
ImageAlign="Middle" Width="64px" ImageUrl='<%# Bind("Image", "{0}") %>' />
</td>
<td valign="top">
<asp:Label ID="Label1" runat="server" Text='<%# Bind("Name") %>'
style="font-size: small">
<br />
<asp:TextBox ID="TextBox1" runat="server" Height="64px"
Text='<%# Bind("Message") %>' TextMode="MultiLine" Width="540px">
</td>
</tr>
<tr>
<td class="style1"></td>
<td class="style3">
 Posted On:  
<asp:Label ID="Label2" runat="server" Text='<%# Eval("date") %>'>
</td>
</tr>


</table>







<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT * FROM [post_scrap]">
Dalek Dave 23-Mar-11 12:20pm    
Edited for Grammar, Syntax and Readability.

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900