473,396 Members | 1,764 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How does Viewstate do it?

Hi,

I've got a crazy idea, but I think I can get it to work, I just need some help.

I want to maintain a datarow across browser sessions. I have a screen where a user will submit some information, but before that data is updated in the database, it needs to be "approved".

I want to know what exactly viewstate is doing to turn that datarow into an encoded string of junk, and then what it does on the return trip to turn it back into the original object.

I want to do just that, just not use the viewstate, but my own routines. I have the idea that if I can encode the information they submit to a string of junk, I can then send an email to the approval people with the information they submitted, and a hyperlink to a webpage with this string of junk in the querystring. If they click it, it is an approval, I have all the information I need in this datarow to update the database. This information is just name/address/telephone, so it shouldn't fill up the querystring limit.

Basically I'm trying to avoid the use of a temporary table to store this information until someone can approve it. Yeah yeah, I know that is the easiest way, but this way is more elegant.

Any ideas?
--Michael
Nov 18 '05 #1
2 1067
I believe the ViewState is simply a Base64-encoded representation of string
data. You can use the Static Convert.ToBase64String() and
Convert.FromBase64String( ) methods to get data into and out of the "encoded
string of junk" format to which you refer.

Good Luck!


"Raterus" <ra*****@spam.org> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi,

I've got a crazy idea, but I think I can get it to work, I just need some
help.

I want to maintain a datarow across browser sessions. I have a screen where
a user will submit some information, but before that data is updated in the
database, it needs to be "approved".

I want to know what exactly viewstate is doing to turn that datarow into an
encoded string of junk, and then what it does on the return trip to turn it
back into the original object.

I want to do just that, just not use the viewstate, but my own routines. I
have the idea that if I can encode the information they submit to a string
of junk, I can then send an email to the approval people with the
information they submitted, and a hyperlink to a webpage with this string of
junk in the querystring. If they click it, it is an approval, I have all
the information I need in this datarow to update the database. This
information is just name/address/telephone, so it shouldn't fill up the
querystring limit.

Basically I'm trying to avoid the use of a temporary table to store this
information until someone can approve it. Yeah yeah, I know that is the
easiest way, but this way is more elegant.

Any ideas?
--Michael
Nov 18 '05 #2
Raterus,

Can you assure that, the user who approves the row will be online
anytime, If so, that's OK.

If there will be a period of delay, I advise you add some field like
"Deal Flag" to the table. When you have a lot of concurrent users,
Session usage like your idea will make your server down, If the target user
will come back to online system 2 or 3 days later.

Anyway, your idea is sure to be right. You will do it.

Edward

--------------------
Hi,

I've got a crazy idea, but I think I can get it to work, I just need some
help.

I want to maintain a datarow across browser sessions. I have a screen where
a user will submit some information, but before that data is updated in the
database, it needs to be "approved".

I want to know what exactly viewstate is doing to turn that datarow into an
encoded string of junk, and then what it does on the return trip to turn it
back into the original object.

I want to do just that, just not use the viewstate, but my own routines. I
have the idea that if I can encode the information they submit to a string
of junk, I can then send an email to the approval people with the
information they submitted, and a hyperlink to a webpage with this string of
junk in the querystring. If they click it, it is an approval, I have all
the information I need in this datarow to update the database. This
information is just name/address/telephone, so it shouldn't fill up the
querystring limit.

Basically I'm trying to avoid the use of a temporary table to store this
information until someone can approve it. Yeah yeah, I know that is the
easiest way, but this way is more elegant.

Any ideas?
--Michael
Nov 18 '05 #3

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

Similar topics

5
by: Christian | last post by:
Hi, Viewstate of WebUserControl does NOT work although the 'EnableViewstate'-property of the usercontrol is set to true Description : Using ASP.Net : I have a created a WebPage with 2...
2
by: Christian | last post by:
Hi, Viewstate of WebUserControl does NOT work although the 'EnableViewstate'-property of the usercontrol is set to true Description : Using ASP.Net : I have a created a WebPage with 2...
6
by: Henri | last post by:
Very strange problem : if I write: <asp:TextBox runat="server" id="myBox" /> the control's ViewState stays always empty, so it loses its properties if it's not always displayed. But if I...
1
by: Secret Squirrel | last post by:
Hi, 1) So I have a Textbox server side control. I edit the value in the control client side, in my browser, and postback by clicking a button. Now on the server-side, the request is...
10
by: Mr Newbie | last post by:
DropDown lists and Listboxes do not appear in the list of controls and values passed back to the server on PostBack in Request.Form object. Can someone confirm this to be correct and possibly...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...

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.