Results 1 to 5 of 5

Thread: [RESOLVED] user control

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2005
    Posts
    182

    Resolved [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

  2. #2
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    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

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 2005
    Posts
    182

    Re: user control

    thanx i would try that..

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Oct 2005
    Posts
    182

    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..

  5. #5
    Fanatic Member
    Join Date
    May 2001
    Posts
    837

    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
  •  



Click Here to Expand Forum to Full Width