Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Getting custom properties on a user control

Reply
Thread Tools

Getting custom properties on a user control

 
 
Boban Dragojlovic
Guest
Posts: n/a
 
      06-24-2003

I created a user web control, and here is the line in my ASPX that consumes
that control.

<joe:RunningSummary CurrentStep=2 id=myRunningSummary runat=server />


The "CurrentStep=2" is supposed to be a "custom property" and I would invoke
this user control with different values on various web forms.


How do I retrieve the value of "CurrentStep" within the code-behind of the
user control?



 
Reply With Quote
 
 
 
 
PJ
Guest
Posts: n/a
 
      06-25-2003
just as you would any property from any control. assuming that you have
your property defined in your control something like this

[Bindable(True), Category("Behavior"), DefaultValue("")]
Public CurrentStep() As Integer
{
get { return ViewState["step"]; }
set { ViewState["step"] = value; }
}

//in page code behind
protected RunningSummary rs;
....
rs.CurrentStep = 12;


~PJ

"Boban Dragojlovic" <news@_N_O_S_P_AM_dragojlovic.org> wrote in message
news:Et3Ka.1062$(E-Mail Removed) gy.com...
>
> I created a user web control, and here is the line in my ASPX that

consumes
> that control.
>
> <joe:RunningSummary CurrentStep=2 id=myRunningSummary runat=server />
>
>
> The "CurrentStep=2" is supposed to be a "custom property" and I would

invoke
> this user control with different values on various web forms.
>
>
> How do I retrieve the value of "CurrentStep" within the code-behind of the
> user control?
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Designer Support: How to have user control's properties appear in IDE's properties window? Max2006 ASP .Net 2 07-13-2007 01:45 PM
Making Custom Control Properties Visible in Visual Studio's Properties Palette Nathan Sokalski ASP .Net Web Controls 0 10-17-2005 02:05 AM
Making Custom Control Properties Visible in Visual Studio's Properties Palette Nathan Sokalski ASP .Net 0 10-17-2005 02:05 AM
Making Custom Control Properties Visible in Visual Studio's Properties Palette Nathan Sokalski ASP .Net Building Controls 0 10-17-2005 02:05 AM
getting to properties of a contorl within a web custom control Ziyad Makki ASP .Net Web Controls 0 07-13-2004 04:21 PM



Advertisments