Reputation: 41
I dont know how to pass value from page.aspx.cs (string url = dr["report_image"].ToString();) to page.aspx ( )
i save image filename (eg:sunset.jpg) to sql database and retrieve it using reader (string url = dr["report_image"].ToString();) and i want to use this url (or filename) to use in the main webpage (aspx). I dont know how to pass this value from ".aspx.cs" to ".aspx"
Any help would be appreciated. thank you
Upvotes: 0
Views: 1466
Reputation: 2311
or you can simply generate Image element in aspx.cs side.
the code below
Image img = new Image();
img.ImageUrl = "your string";
Upvotes: -1
Reputation: 4738
<asp:Image ID="img" Runat="Server" />
Аnd in the code:
img.ImageUrl = url
Upvotes: 2