problem: popup image onclick gridview image using model popup and web service

Posted by Abhijit.barua under ASP.NET on 11/16/2011 | Points: 10 | Views : 1839 | Status : [Member] | Replies : 1
I am sending image path(as image save in folder) from web service like

[System.Web.Services.WebMethod(), System.Web.Script.Services.ScriptMethodAttribute()]
public static string GetDynamicContent(string contextKey)
string constr = "Data Source=Subhasish-PC;Initial Catalog=testabhijit;Integrated Security=SSPI;";
string query = "SELECT ImagePath FROM imagetable WHERE id = " + contextKey;

SqlDataAdapter da = new SqlDataAdapter(query, constr);
DataTable table = new DataTable();

string x = table.Rows[0]["ImagePath"].ToString();

return x.ToString();


Now at .aspx page i am taking panel and image control, like below

<asp:Panel runat="server" CssClass="modalPopup" ID="panSaving" Style="display: none">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<asp:Image ID="imgClose" runat="server" ImageUrl='' Height="336" Width="430"/>


My problem is how i will bind ImageUrl of image that which path is sending at web service i can access. Thank you.


Posted by: Walia_jagwinder on: 11/17/2011 [Member] Starter | Points: 25

On which event you want to bind the image?

One person's data is another person's program.

Abhijit.barua, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response