How to know which page has called the Usercontrol
I have a usercontrol(.ascx) page that is us开发者_JAVA技巧ed by about 10 pages to display something in common. In the control i should know which aspx page is using(or calling). How is that possible?
Thank you in advance!
You can get the page object by calling:
this.Page
Or the URL by calling
HttpContext.Current.Request.Url
You can check Request.Url
or (Page)HttpContext.Current.Handler
.
The control has a Page
property that will be set to the page that it is on.
精彩评论