0

This is a weird one.

Long story short: wrote a usercontrol using AJAX. Used return of smart part v1.3 to plug it into a sharepoint 2007 (development) site.

Works perfectly!

Moved it all to a production server - modified the web.config file to be exactly like the development site. It's not working.

It's weird because, I'm pretty sure the ajax is actually working, since the updateprogress is working, and I get an error in my ajax_endrequest js handler - after my second ajax request (as in - I press a button once, nothing, I press it again) I get:

"Invalid postback or callback argument. Event validation is enabled using in configuration..."

I have a linkbutton with javascript__doPostback, which seems to work - at least it's running the code - but it's not updating anything in the updatepanel.

Another example of it not working: I have a tab-panel, and a listbox set to autocomplete. In the selectedindexchanged I change the active tab panel - but this isn't working. When I do it twice I get the same aforementioned error back in my javascript end request handler.

Can ANYONE point me in ANY direction!? :)

4
  • 1
    have you tried using Fiddler or similar to see the HTTP traffic? Commented Feb 3, 2011 at 13:12
  • Fiddler actually shows no activity at all regardless of what I do. Odd - since I get an exception in endrequest? Commented Feb 3, 2011 at 13:46
  • Can you give us the long story and show us some code? I know this targets principles really but context coverage always helps. Commented Feb 3, 2011 at 13:59
  • I would actually love to, the trouble is - I don't know what to show you. Since it all works perfectly on my development machine, the one thing I could think of was the web.config file for the production environment - which is now identical. However - the prod. server is setup to use https/ssl - could this have an impact? I tried setting <authenticationService enabled="true" requireSSL="true" /> in the web.config file - no change Commented Feb 3, 2011 at 19:38

2 Answers 2

1

Okay...

I have to vent. This problem took me way too long to fix.

The problem was in the masterpage in sharepoint. Since I wasn't using the default masterpage, apparently this line:

<WebPartPages:SPWebPartManager runat="server"/>

Was outside the tag - when it's moved down inside it (which is is in the default-masterpage, I was using on my development machine), everything works great -.-

I hate sharepoint sometimes...

Sign up to request clarification or add additional context in comments.

Comments

0

I think because you are using AJAX you are running into issues with event validaiton. Since the JavaScript is firing events, ASP.NET cannot verify the source of the triggered event handlers thus throwing errors left and right.

You can disable event validation globaly:

<system.web>
   <pages enableEventValidation="false"/>
</system.web>

or on a single page:

<%@ Page EnableEventValidation="false" ... %>

The same applies for view state validation... on controls that JavaScript has interacted on... And here is the code to fix it:

web config:

<pages enableViewState="false" />

or on a single page:

<%@ Page ... EnableViewState="false" %>

2 Comments

Well - that gets rid of the exceptions - however, the ajax still isn't working properly. It looks like it is - because the UpdateProgress is being initiated, but nothing happens.
When I strip it all down, I have a simple button, in the code I first set a labels text in the updatepanel, and then throw an exception - the label isn't changed, but the ajax endrequest handler gets the exception and displays it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.