-
[RESOLVED] user control
is it possible to call an aspx page from a user control...
for example i have a user control inside a gridview...on row databound..i am creating this control...the job of this control is to display an image...
if i can call image.aspx?id=292020 in that control that would go and display the image...
can anybody plz suggest me an idea..thanx
-
Re: user control
If you are sure the page will only return an Image you can use Image.FromStream()
example:
Code:
Image img = Image.FromStream(System.Net.WebRequest.Create("image.aspx?id=292020").GetResponse().GetResponseStream());
-
Re: user control
-
Re: user control
can you also tell me if i am using asp:imagefield in a grid view how cani actually find it at rowdata bound..
-
Re: user control
When the row databound event fires the event args should have a reference to that row. That reference derives from Control which has the FindControl() method. If you've given the imagefield an id then you can use the FindControl method to get a reference to the imagefield based on it's ID. It doen't matter that there will be many imagefields in the grid, ASP.NET takes care of making the ID's unique yet still allowing you to access the control through FindControl.