Script callback returning ViewState?

Tech-Archive recommends: Fix windows errors by optimizing your registry



Okay, I'm pretty baffled by this one.

I've got a page in a popup which takes a postcode; looks up a list of
addresses for that postcode; then uses a callback to get the details
for a specific address, build a JS object and pass it back to the
window.opener.

This used to work, but without any obvious cause it has started
throwing an error. The error text comprises the XML returned from the
server AND (mysteriously) the viewstate. Here's the callback method:

<code>

public string GetCallbackResult()
{
return LoadSingleAddressAsXml(_callbackArg);
}

private string LoadSingleAddressAsXml(string addressId)
{
Connection accountDetails = GetAccountDetails();
PostcodeAnywhereProvider data = new
PostcodeAnywhereProvider(accountDetails);
FullAddress address = data.getAddress(addressId);

StringWriter Output = new StringWriter(new StringBuilder());
XmlSerializer s = new XmlSerializer( typeof( FullAddress ) );
s.Serialize(Output,address);

Trace.Warn(Output.ToString());

return outstring;
}

</code>

The trace shows a perfectly correct response without any additional
text.

The JS looks like this

<code>
addInitFunc(initCallback);

function initCallback()
{
pageUrl='/PostcodePopup.aspx';
_InitWebCallback();
}
function doCallback()
{
var list = getSingleElement("selAddress", "select");
var aId = list.options[list.selectedIndex].value;

WebForm_DoCallback('__Page',aId,receiveCallBack,null,oncallbackerror,true);
}

function onCallbackError(e)
{
alert("Oops! An error occurred while contacting the server!\nPlease
try again in a moment\n"+e);
}

function receiveCallBack(xml)
{
var oDomDoc = Sarissa.getDomDocument();
oDomDoc.loadXML(xml);
var oAddress = parseAddress(oDomDoc);
sendAddress(oAddress);
}
</code>

The onCallbackError function is called and my alert runs something like

Oops! An error occurred on the server, please try again in a moment
/wEWHQLggdzjDgLJrO+CAQLAzrGoBwLt/YqPAwLO547CDgLt/ZbPAgLO55qCDgLt/dIPAs7n1sIPAu39vs8DAs7nooIPAu39+o8BAs7nvsQEAu39xk8CzueKhAQCk6Wj9QcC7f2Cjg4Ck6WPtQcC7f3uzwECk6XL9QQC7f3qgQcCk6XXtQQC7f32wQYCk6WT9AUCzufeQwKTpf+1BQLO56oDAs7n5sMBAs7n8oMBOUBN2Lkkie4wjPMIfrnhEv/BivE=
<Address Building="My Parent's Address" Street="My Parent's Road"
Locality1="Deepest Darkest Derbyshire" Locality2=" Locality3=""
town="None Worth Mention" postcode="ABC 123" county="Derbyshire"
country-id="335" address-id="0" />

.



Relevant Pages

  • Re: Fixed Address Function
    ... The first line is going to throw an error when address or PostCode is Null. ... Public Function FixedAddressAs String ... 'vbCrLf Carriage return/line feed ... Dim newAddress As String ...
    (microsoft.public.access.queries)
  • Re: UK postcode issue
    ... As long as the first part of the Postcode is valid, ... Most invalid codes will return the Null string and -1 (again ... Dim blDone As Boolean ... If VarTypevbString Then Exit Function '** ...
    (microsoft.public.access.queries)
  • RE: Sort Alphanumeric post codes
    ... Dim strAlpha As String ... Dim strNum As String ... The function returns the postcode with the numeric element formatted to four ...
    (microsoft.public.access.queries)
  • RE: Sort Alphanumeric post codes
    ... "Ken Sheridan" wrote: ... Dim strAlpha As String ... The function returns the postcode with the numeric element formatted to four ...
    (microsoft.public.access.queries)
  • Re: UK postcode issue
    ... > second half of the postcode. ... > Function AlphaPartAs String ... > Dim strReturn As String ... > Dim blDone As Boolean ...
    (microsoft.public.access.queries)