asp-usercontrols

ASP.NET: Call function in MasterPage through UserControl

Calling a function from the MasterPage in a Page is quite straigt forward but how do I call it for a UserControl: Adding <%@ MasterType VirtualPath="~/MasterPage.master" %>, doesn't work on UserControls. So this.Page.Master.MyFunction() fails :( ...

ASP.NET: Best way to customize MasterPage driven by Page

I have quite simple site structure with one mastepage and a bunch of pages. The mastepage is quite advanced though and I need from the page be able to control certain aspects of the Masterpage. I want to be able to enter these directive in the aspx file to not clutter the code behind files. My idea was to create different "directive" ...

User Control ViewState/State Help needed

I need help making this code work better. Currently, what happens is when it reloads, I loose the third value which is a calculated value . I would like for my page to reload without loosing the values for each property and each instance of the user control on the page. Thanks in advance Private _Length As Double = 0.0 Publi...

Passing Control ID from one Web User Control into another

I have a Web User Control that holds many others User Controls. I'd like to name those embedded controls based on the ID of the parent user control. I'm trying this code inside the main User Control: <myLibrary:myChildUserControl1 ID="<%=ID%>" runat="server" /> or <myLibrary:myChildUserControl2 ID="<%=ID%>_OkButton" runat="server" /...