|
-
Sep 6th, 2006, 08:41 PM
#1
Thread Starter
Addicted Member
[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
-
Sep 6th, 2006, 09:46 PM
#2
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());
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Sep 6th, 2006, 10:14 PM
#3
Thread Starter
Addicted Member
-
Sep 6th, 2006, 10:15 PM
#4
Thread Starter
Addicted Member
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..
-
Sep 7th, 2006, 04:45 PM
#5
Fanatic Member
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.
The human brain cannot hold all of the knowledge that exists in this world, but it can hold pointers to that knowledge.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|