Groups | Blog | Home
all groups > asp.net > may 2004 >

asp.net : Adding Properties to .aspx and .ascx files


pubb AT hotmail DOT com
5/8/2004 7:58:53 PM
To answer your first question, it depends on how you implement the
property :) If you use private fields, then the answer is no. I think
this is what you're looking for.

private int InvoiceNumber
{
get{return (int)ViewState["InvoiceNumber"];}
set{ViewState["InvoiceNumber"] = value;}
}


[quoted text, click to view]
Red
5/8/2004 8:48:04 PM
I am considering adding some properties to my user conttrol and web forms
how ever I am not sure if this will work. The web control I am using fill a
data grid for a specific invoice. I would like to add a property to the web
control so that I can use this invoice number in oth operations of the
control.

Will this property "Survive" a post back?

Do I have to add view state code to keep the properties set through multiple
post packs??

Thanks in advance.

Red

AddThis Social Bookmark Button