Saturday, March 24, 2012

Ajax and HttpModules help needed

Hello, Smile

I created a HttpModule that uses an IHttpModule to add content to the start of the webpage, but i get the error of:

Sys.webforms.pagerequestmanagerparsererrorexception: The message received from the server could not be parsed. Common causes for this error are when the response if modified by calls to response.write(), response filters, httpmodules, or server trace is enabled. Details: Error parsing near '<h4>Request Begins

I tried to put the AJAX ScriptModule before and also after but I still cannot get this to work

Is there something i need to do to make this work, or am I just out of luck because you cannot change or add to the page due to AJAX

The code I am using is:


Implements IHttpModule


Public Sub Dispose() Implements IHttpModule.Dispose
' add clean-up code here if required
End Sub

Public Sub Init(ByVal app As HttpApplication) Implements IHttpModule.Init

AddHandler app.BeginRequest, AddressOf MyBeginRequest
End Sub

Public Sub MyBeginRequest(ByVal s As Object, ByVal e As EventArgs)
Dim app As HttpApplication
app = CType(s, HttpApplication)

app.Response.Write ("<h4>Request Begins Here...</h4>")
End Sub

Hi Tdar,

Check out thishttp://weblogs.asp.net/leftslipper/archive/2007/02/26/sys-webforms-pagerequestmanagerparsererrorexception-what-it-is-and-how-to-avoid-it.aspx

Hope this helps,

No comments:

Post a Comment