In VS2013 Ultimate; asp.net; a website (not web application); vb.net; Win7 Pro
I'm refurbishing a website from 2007, all idiosyncratic JS and vb.net, with some JQ thrown in. Essentially a single webform with lots of functionality packed into it. It uses the original <%=CallBackSenderSetupString%> type callbacks, not Ajax. It has probably 20 different JS originated callback-based functions, all work fine, except this one, which I'll call UpdateForm, which unfortunately is too complicated to post.
The problem is that the UpdateForm function leads to a non-callback postback (code control suddenly shifts to the Page_Load routine, not IsCallback) with no apparent user-code driven action. The UpdateForm function uses code blocks derived from very similar functions, and the same user-written callback processing cycle as all the other callback functions, and they all work fine without having this problem.
I'm carefully tracing the code path to see what happens, but I can't locate where it occurs. It's very possible that it's a user code problem however, I can't find it, after much hair pulling.
The particular function cycle in question does this:
- via callback & json, fetches fields from a single record in the database
- dynamically creates and display a "pseudo-DetailsView" form (the "UpdateForm"), with the fetched data fields (filling a container on the page, which is a div, not an asp:Panel; this follows existing code patterns that work fine.)
- on the JS generated "edit" button click, it converts the display spans to text fields, with the fetched data, and displays locally JS generated "update" and "cancel" buttons.
- User edits the fields, presses "update"
- the JS update function captures the text field information, sends it via callback to the server
- Server edits the received text, and returns (in the same callback cycle) either
- an error message or,
- a rebuild of the form with the new data
The entire update cycle works fine. The edit messages show up accurately, and the new field values are displayed.
The problem is that the entire webpage immediately goes into the Page_Load subroutine, NOT as a callback, which erases the returned form with the new updated values.
Again, I'm tracking the code in detail, can't find anything that would prompt the "submit". I've put in lots of try/catches, nothing shows up. And again, there are many other similar cycles in the code that work fine.
The only clue that seemed to matter is that in one tracking sequence the code would suddenly jump from the JS on the client into the Page_Preload (which is where I was tracking it from). But I cannot now reproduce that.
So, my question here is, are there any known ways in which callbacks can "fail" or otherwise initiate "submits", that I might look for? Or, if that's "impossible", then that would at least make me focus more on the user code.
Any help with this would be appreciated.
Thanks!
Aucun commentaire:
Enregistrer un commentaire