Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Adding Properties to .aspx and .ascx files

Reply
Thread Tools

Adding Properties to .aspx and .ascx files

 
 
Red
Guest
Posts: n/a
 
      05-09-2004
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


 
Reply With Quote
 
 
 
 
pubb AT hotmail DOT com
Guest
Posts: n/a
 
      05-09-2004
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;}
}


Red wrote:
> 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
>
>

 
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
Class properties and object properties SuperZE Python 5 10-06-2008 02:14 PM
ViewState properties and mapped properties don't work well togethe Christophe Peillet ASP .Net Building Controls 2 01-21-2006 07:35 PM
CompositeControls: ViewState properties w/ Mapped properties probl =?Utf-8?B?Q2hyaXN0b3BoZSBQZWlsbGV0?= ASP .Net 1 01-19-2006 09:19 AM
ViewState properties and mapped properties don't work well togethe Christophe Peillet ASP .Net Web Controls 1 01-19-2006 09:01 AM
Making Custom Control Properties Visible in Visual Studio's Properties Palette Nathan Sokalski ASP .Net 0 10-17-2005 02:05 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57