i have about 10 pages using the same User Control,now i need to know each time what Page invoked the user control.and i need the page name(title).
Use event and delegate concept make delegate as same signature as your method in parent page and then assign parent methad to it in parent page load event then call this delegate through event in user control. code sample and link is given below. Show activity on this post.
Answers. In your user control code behind (C#) you can use... HiddenField hf = (HiddenField)Parent.
Try using within the control code:
this.Page.Title
This is using javascript ,
<script language="javascript">
var parentName= "<%= System.IO.Path.GetFileName(Page.Request.Path) %>";
</script>
or
this.Parent.Page.Title;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With