Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Control Not remembering property on postback

Reply
Thread Tools

Control Not remembering property on postback

 
 
Teemu Keiski
Guest
Posts: n/a
 
      07-13-2005
Hi,

where in the lifecycle / events you reading/writing the value? Init, Load,
postback event, PreRender...?

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke


 
Reply With Quote
 
 
 
 
Chris Kennedy
Guest
Posts: n/a
 
      07-13-2005
I am having problems getting my customer control to remember properties
accross postback. I have tried setting it to a session. What is the
recommended way of doing this.

I have tried this
'set it to session
_location = Value.ToString()
System.Web.HttpContext.Current.Session("XmlPath") = _location

'on the postback where I have the problem if the location is empty read in
the session

if _location = "" then
_location = System.Web.HttpContext.Current.Session("XmlPath")
end if


 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      07-13-2005
If I understand correctly what you mean (just in member declarations), then
yes, it could be the reason. Try setting it in some event like Load (it just
should be set before accessed).

Are you still reading it normally in some event?.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke


 
Reply With Quote
 
Chris Kennedy
Guest
Posts: n/a
 
      07-14-2005
I am just setting the property in the public declarations like with any
object. This is in any event. Is this where I am going wrong?


"Teemu Keiski" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> where in the lifecycle / events you reading/writing the value? Init, Load,
> postback event, PreRender...?
>
> --
> Teemu Keiski
> ASP.NET MVP, AspInsider
> Finland, EU
> http://blogs.aspadvice.com/joteke
>
>



 
Reply With Quote
 
Chris Kennedy
Guest
Posts: n/a
 
      07-15-2005
The property is set in the Load event of the parent page. It's just on
postback the control doesn't remember the property?

The control has some control and a button control. I have added an event to
the button click. When I try to access the property in the onCLick event it
can't find the property.


"Teemu Keiski" <(E-Mail Removed)> wrote in message
news:ODvON8#(E-Mail Removed)...
> If I understand correctly what you mean (just in member declarations),

then
> yes, it could be the reason. Try setting it in some event like Load (it

just
> should be set before accessed).
>
> Are you still reading it normally in some event?.
>
> --
> Teemu Keiski
> ASP.NET MVP, AspInsider
> Finland, EU
> http://blogs.aspadvice.com/joteke
>
>



 
Reply With Quote
 
Teemu Keiski
Guest
Posts: n/a
 
      07-18-2005
Post the entire code which is relevant to this scenario.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke



 
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
Remembering textbox values on postback Louisa99 ASP .Net 4 05-05-2009 03:35 PM
[asp] remembering values after postback - changes values Piotrek \Alchemik\ ASP .Net 0 11-12-2006 09:18 PM
Mozilla not remembering form data Wim Cossement Firefox 0 04-12-2005 12:32 PM
mozilla news reader not remembering who I am william kossack Firefox 3 01-21-2005 05:19 AM
Internet explorer not remembering homepage, xuptier? Craig Sutton NZ Computing 3 01-15-2004 07:14 AM



Advertisments