Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - Missing Viewstate

 
Thread Tools Search this Thread
Old 11-04-2009, 06:16 PM   #11
Default Re: Missing Viewstate


Getting nearer - but its more complicated. The Logging issue above is
still worrying but I have commented that out. This code appears to be
the offender

HttpWebRequest request = (HttpWebRequest)base.GetWebRequest(uri);
request.ProtocolVersion = HttpVersion.Version10;
request.Headers.Add("Accept-Encoding", "gzip, deflate");
if (mCallMetrics != null)
{
mCallMetrics.NetworkSendStarted = DateTime.Now;
request.Headers.Add("X-EBAY-API-METRICS", "true");
}
return request;

However, the code then goes on to do some trickery reading and writing
to memorystreams. Could this be upsetting the session being delivered
to the browser?


Kev
  Reply With Quote
Old 11-04-2009, 06:17 PM   #12
Kev
 
Posts: n/a
Default Re: Missing Viewstate
>But, I do believe that David is correct, that using Server.Transfer is not
>transfering your session state. It's working the first time because of the
>initial session variable you set, but after that it's being lost. Do you
>have a specific reason for using Transfer vs. Redirect, which would solve
>the problem.
>- Scott

Maybe, but when offending code is commented out as discussed I can
visit the page as often as I want and the session remains in tact.
Something somewhere is upsetting the session.




Kev
  Reply With Quote
Old 11-04-2009, 06:24 PM   #13
Kev
 
Posts: n/a
Default Re: Missing Viewstate
OK - some code - but its getting detailed so hope someone can help.

After invoking the webservice the code ends up here

public override void ProcessMessage
(System.Web.Services.Protocols.SoapMessage Message) {
if ((Message.Stage ==
System.Web.Services.Protocols.SoapMessageStage.Bef oreSerialize)) {
}
else {
if ((Message.Stage ==
System.Web.Services.Protocols.SoapMessageStage.Aft erSerialize)) {
this.SaveRequestMessage(Message);
this.Copy(mStrNew, mStrOld);
}
else {
if ((Message.Stage ==
System.Web.Services.Protocols.SoapMessageStage.Bef oreDeserialize)) {
this.SaveResponseMessage(Message);
}
else {
if ((Message.Stage ==
System.Web.Services.Protocols.SoapMessageStage.Aft erDeserialize)) {
}
else {
throw new System.ArgumentException
(System.String.Format
(System.Globalization.CultureInfo.InvariantCulture , "Invalid Soap
Message stage [{0}]", Message.Stage), "Message");
}
}
}
}
}


It actually traces to this part
if ((Message.Stage ==
System.Web.Services.Protocols.SoapMessageStage.Aft erSerialize)) {
this.SaveRequestMessage(Message);
this.Copy(mStrNew, mStrOld);

And it si the copy routine which causes the problem (but also gets me
the data I need).

/// <summary>
///
/// </summary>
/// <param name="StrFrom"></param>
/// <param name="StrTo"></param>
private void Copy(System.IO.Stream StrFrom, System.IO.Stream
StrTo) {
if (StrFrom.CanSeek) {
StrFrom.Position = 0;
}
System.IO.TextReader TxtReader = new System.IO.StreamReader
(StrFrom);
System.IO.TextWriter TxtWriter = new System.IO.StreamWriter
(StrTo);
TxtWriter.WriteLine(TxtReader.ReadToEnd());
TxtWriter.Flush();
if (StrTo.CanSeek) {
StrTo.Position = 0;
}
}

Is something there stopping the session propagating?


Kev
  Reply With Quote
Old 11-04-2009, 07:09 PM   #14
Kev
 
Posts: n/a
Default Re: Missing Viewstate
PROBLEM SOLVED!!!!!

http://weblogs.asp.net/owscott/archi...21/438678.aspx

The eBay API was writing a log file in the bin folder!!!!! And a
change here causes a session reset. I have moed the log file and
problem solved. Should of stuck to my first LogMessage hunch!

Thank you both for your help! GOing to scour some groups for 10
minutes now answering other peeoples questions (on sql) where I can!

Kevin


Kev
  Reply With Quote
Old 11-04-2009, 07:41 PM   #15
Scott M.
 
Posts: n/a
Default Re: Missing Viewstate

"Kev" <> wrote in message
news:ed6de632-b16f-4fae-9136-...
> PROBLEM SOLVED!!!!!
>
> http://weblogs.asp.net/owscott/archi...21/438678.aspx
>
> The eBay API was writing a log file in the bin folder!!!!! And a
> change here causes a session reset. I have moed the log file and
> problem solved. Should of stuck to my first LogMessage hunch!
>
> Thank you both for your help! GOing to scour some groups for 10
> minutes now answering other peeoples questions (on sql) where I can!
>
> Kevin


Good investigative work. Good luck.

-Scott




Scott M.
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Linksys tech support live chat transcript - enjoy!!!! jim Wireless Networking 2 07-01-2008 05:19 AM
System Restore -to start with...... =?Utf-8?B?SGFycnkgS2VvZ2g=?= Windows 64bit 3 12-01-2005 08:58 AM
PowerPost2000 and reposting missing segments. English Patient Computer Support 6 09-15-2004 11:49 PM
Invalid Backweb Mike Doherty Computer Support 3 01-30-2004 08:02 PM
Re: Pentagon 9/11: The Missing Wings Baron Maximillian von Schtuldeworfshiseundurheimhoppen Computer Support 0 10-27-2003 06:09 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46