Results 1 to 2 of 2

Thread: How does my web user control know what page it is on?

  1. #1

    Thread Starter
    Hyperactive Member greg_quinn's Avatar
    Join Date
    Nov 2002
    Location
    South Africa
    Posts
    366

    How does my web user control know what page it is on?

    In my web user control's code, I would like to be able to programatically access which URL it is called on.

    For instance, lets say I have a web page, mypage.aspx and on it I call my control, myControl

    mypage.aspx
    -------------
    <cc1:myControl Text = "Hi"></cc1:myControl>


    Now in the code behind for myControl, how can I determine that the page the control is sitting on it mypage.aspx???
    He who has conquered himself, is far greater than he who has conquered a thousand men... - The Buddha

  2. #2

    Thread Starter
    Hyperactive Member greg_quinn's Avatar
    Join Date
    Nov 2002
    Location
    South Africa
    Posts
    366

    Re: How does my web user control know what page it is on?

    Don't worry, figured it out... You have to use Context...
    i.e

    Context.Request.ServerVariables["URL"].ToString();
    He who has conquered himself, is far greater than he who has conquered a thousand men... - The Buddha

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