meta refresh loosing the viewstate on the TextBox

P

Prodip Saha

I am sure there is an easy fix for this problem. I am reloading the same
page at an interval using the meta refresh tag in aspx page. This page has
one textbox and one button. The problem is -when the page get posted back to
the server the value of the textbox is gone. How do I preserve the value of
the textbox that I entered in it?

I don't want to use Cache/Session to keep track of the value. That's not an
option.

Thanks for your reply.
Prodip
 
S

Steve C. Orr [MVP, MCSD]

Your problem is that the meta refresh doesn't cause a postback. Rather,
it's a completely new page request. Therefore viewstate is not saved.
Perhaps you should use a javascript timer instead to manually cause a
postback.
Or you could maybe stick with the meta refresh and store data in Session
instead of ViewState.
 
P

Prodip Saha

Steve,
That explained the underlying problem (new request). I was using the meta
tag and setting the refresh time according to the work-flow. I will try to
use javascript instead to preserve the viewstate, as you have suggested.

Thank you much.
Prodip
 

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,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top