Wednesday, 13 January 2010

Passing a parameter/value from a host page to a user control

This goes in your control:
private String _ValueID;
    public String ValueID
        get { return _ValueID; }
        set { _ValueID = value; }
And you can set the value in your host page either like this:
<uc2:SubNav ID="SubNav1" runat="server" ValueID="whatever" />
or in your host code-behind like this:
SubNav1.ValueID = "whatever";

No comments:

Post a Comment

Comments are moderated, so you'll have to wait a little bit before they appear!