Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MM.Net Web User Control
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01275773
Message ID:
01276207
Views:
20
>If I create a web user control based on the MM.NET Web user control, how do I access the properties, etc of this class on the web form that the user control is placed?

(1) Set a reference to the user control in the Web Form.
<%@ reference control="~/VideoPlayer.ascx" %>
(2) Expose your private variables as public properties, using setters in the control. (You can also expose Web Control values in your user control through these setters.)
private int id;

public int Id
{
  set
  {
    id = value;
  }
}
(3) The opposite also works in the control, but you cannot do both. You'll get a circular reference error.
<%@ reference page="~/Default.aspx" %>
Also, you're probably already are aware of this, but your user control should inherit from mmUserControl, and here's how you register MM.NET business objects in the user control:
category = (Category)BusinessWebPage.RegisterBizObj(new Category());
Regards,

Fred Chateau
Previous
Reply
Map
View

Click here to load this message in the networking platform