Adding Properties to .aspx and .ascx files

R

Red

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
 
P

pubb AT hotmail DOT com

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;}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top