passing data

kaisersoze

Centurion
Joined
Aug 27, 2003
Messages
152
Hi
I know similar question has appeared manytimes, but i have few more questions...
My clients requirement is, no to querystring, no sessions, no cookies. I need to use only post method to send data from one page to another page. User information is stored in page.user object, so we can retreive whenever we want as long as the session is not expired. but, on click event of image buttons in the menu i need to post few values (property number, block, lot, etc. total 6 fields). In classic asp i used to hold these values in a hidden text box and post it. I was trying to do the same by writing javascript code. I am getting a view state error "The viewstate is invalid for this page and might be corrupted"

if i redirect it works, but if i submit using javascript i get the above error. Is there any other way for posting the data between page. and did anyone get the above error.
 
Last edited:
On the second page, is there any type of postback invovled? I've had a similar problem, page 2 is thinking that the submit is coming from itself, so its checking its own Viewstate and returning the error becuase in reality Page1 is sending the post. So, you can try to disable the ViewState on Page 2. Not sure if this is your problem exactly.
 
yes i have few postbacks in page 2.
But, in my case it is not going for the first time itself. here is the code....

<a href="javascript:jfGoto('~/UCCSControls/UCCS.aspx')"><img id="img" alt="test"></a>
.....
.....
<script language=javascript>
function jfGoto(vMe) {
......
(here i move some values into hidden text fields)
......
document.Form1.method = "post";
document.Form1.action = vMe;
document.Form1.submit();
}
</script>
 
Well, regardless of whether you are checking IsPostBack, the orginal post is causing the 2nd page to see if its Viewstate has been meddled with. I suspect that is the problem. Again, that was my problem. The solution I had was to just redesign my page flow so that everything is done in one page.
 
my design is like this... it is like a portal, so i have only one aspx page and rest is ascx controls. so depening on the click of menu, i load an appropriate ascx control in the placeholder. initially i used to send the control name in querystring, and do a request(object) and load the control. but sending as querysrting, i need to check whether the user has access to that control or not and then load. which i what i am doing now. but if we can post values from page, then i thought i can reduse some database hits. i will post if i find some findings....
 
Back
Top