473,748 Members | 3,604 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

meta refresh loosing the viewstate on the TextBox

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
Nov 19 '05 #1
2 2221
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.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net

"Prodip Saha" <ps***@bear.com > wrote in message
news:O1******** ******@TK2MSFTN GP11.phx.gbl...
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

Nov 19 '05 #2
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

"Steve C. Orr [MVP, MCSD]" <St***@Orr.ne t> wrote in message
news:uX******** ******@TK2MSFTN GP11.phx.gbl...
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.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net

"Prodip Saha" <ps***@bear.com > wrote in message
news:O1******** ******@TK2MSFTN GP11.phx.gbl...
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


Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
11261
by: Shiperton Henethe | last post by:
Hi Is there anyway to get a meta refresh to do so in an new browser window? e.g. This code forwards this user after 8 seconds... <meta http-equiv=refresh content=8;url=http://www.auction-air.com/index.html> Is it possible to do so but in a new window, ideally one without focus - i.e. a "pop under" but only do so after a number of seconds...
10
2277
by: neo | last post by:
hi, I am studying ASP.NET and have few questions - 1) The session ID and values of controls is stored in VIEWSTATE variable. So now when we put EnableViewState="false" in Page directive and disable the session state in Web.Config the VIEWSTATE variable is still maintained and stores some values. Can anyone tell what those values are for, i.e what other info is stored in VIEWSTATE other than the session ID and the control values ?
1
1958
by: Maziar Aflatoun | last post by:
Hi everyone, My goal is to modify the contents of my meta tag (html refresh). However, my code adds a new instance of the meta tag at the bottom of the page. Is there a way to modify it instead of adding a new one? <head> <title>WebForm1</title> <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1"> <meta name="CODE_LANGUAGE" Content="C#">
7
2043
by: et | last post by:
I'm not sure I understand the use of the ViewState. Do I understand correctly that values of controls are automatically held in a hidden control called ViewState? If so, then why can't we get them, or how do we get that value? I always have to set the ViewState("FirstName") = txtBox.text myself before a postback is done, otherwise, the value of ViewState("FirstName") is always empty; there doesn't seem to be a way to retrieve that...
4
5026
by: D. Shane Fowlkes | last post by:
This may be a very simple question but I'm stumped none the less. I have a form where a user provides comments. There's a Grid below this form which displays all comments in the table so far. On the Page_Load sub, this grid is loaded. When they submit the form, a SaveComments Sub will insert the record into a table and then disable the button and textbox (greyed out) and display a message in a asp:label saying "thank you...". The last...
4
3086
by: Tim::.. | last post by:
Can someone please tell me why the following dynamic refresh doesn't work! Thanks Inline code... <!----- dynamically filled META REFRESH element -----> <meta id="mtaRefresh" runat="server" /> ...CodeBehind
0
1430
by: jobs | last post by:
I have a page where users select from a bunch of gridviews, setting session variables and then hit an a New or Edit button which redirects them to a formview in edit or insert mode. While in that formview page they might do a bunch of postbacks, so the back button might not always have the desired affect of taking them back to the calling page. problem #1, a normal back, will only take them to the page from the prior postback, which...
1
3508
by: Falcula | last post by:
Hello, I have a treeview control, when i select a item i navigate to url. But selected node is lost, it reset itself, loosing state. I post my code here. Thanks in advance. <script language="javascript">
2
12270
by: qwedster | last post by:
Folks! The following is a "Hello World" kind of code for ViewState. I just want to know how to retain the ViewState 1) while Page Refresh when using UpdatePanel and also 2) While I reverting back to the page after round trip when using UpdatePanel? In the following code snippet the ViewState is killed when I click page refresh or when I go some page and revert back Code Snippet: // Default.aspx:
0
8991
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8830
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9544
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9247
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8243
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6074
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2783
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.