TechShri from Shriniwas Wani

Custom Search

31 March, 2009

Access User Control's Variable Property Inside an ASPX parent Page

Here is great way to access User control's public property inside a parent page in ASP.Net

If TotalNumberOfItemsAdded is the public property inside user control's code-behind file. And if you are setting this property in Usercontrol's code behind only then to access the property in the ASP.NET Web page:

Register the user control, make sure property is PUBLIC so that page can access it.

< uc:control id="ucntrl1" runat="server" >

Now you can access the property in your page like <%= ucntrl1.TotalNumberOfItemsAdded %>

Labels:

0 Comments:

Post a Comment

<< Home