Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MM.Net Web User Control
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01275773
Message ID:
01276207
Vues:
19
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform