Abhijit barua

Abhijit barua

  • 1.2k
  • 508
  • 310.1k

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

Nov 17 2011 7:18 AM
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();

da.Fill(table);
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%">
<tr>
<td>
<asp:Image ID="imgClose" runat="server" ImageUrl='' Height="336" Width="430"/>
</td>
</tr>

</table>
</asp:Panel>

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

Answers (1)