|
Rank: Member Groups: Member
Joined: 7/1/2007 Posts: 17
|
I have a problem activating Datagrid update method. It changes the javascript action of the update button to use
WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl03$ctl03$dataGridAllocations$ctl02$ctl00", "", true, "", "", false, true)) instead of a simple __doPostBack call.
Somehow the WebResource.axd file is not downloaded and it is complaining that WebForm_DoPostBackWithOptions is not defined.
Is there any know problem with datagrid embedded inside nested CallbackPanels?
Thanks
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi Tommy,
This can happen but it's not a problem of our controls. We do not change the Javascript code that is attached to the update button. Our CallbackPanel works by interception form.submit (which __doPostBack ultimiately calls) and turn the postback into callbacks. So whatever you see, whether it's __doPostBack or WebForm_DoPostBackWithOptions is rendered by ASP.NET, not us.
It is possible that initially ASP.NET renders __doPostBack, but after Callback, some of your code triggered ASP.NET to render WebForm_DoPostBackWithOptions. In that case you would run into the problem you mentioned. For example, if you have a Validator control in your code, it would render WebForm_DoPostBackWithOptions, otherwise it would render a straight __doPostBack. So if your page initially does not have a validator, it would render a __doPostBack, but then after a callback you turned on a validator, that would trigger ASP.NET to render WebForm_DoPostBackWithOptions, which causes the problem you mentioned.
The easiest workaround is to inform ASP.NET to render the correct WebResource.axd at the very begining, before the Callback is even triggered. In the sample above, you can put in a validator at the very begining (You may need to hide it inside a hidden DIV so that it's not visible) to avoid the problem.
Thanks
|
|
Rank: Member Groups: Member
Joined: 7/1/2007 Posts: 17
|
Thanks for you advise.
May be I need to clarify the architecture of the application. My application was designed to work very much like the demo app from EO. Therefore the default.aspx should never get reloaded or postback, only the callback panels should be reloaded from time to time. I have tried to force the WebResources.axd to be loaded, but once it is loaded, it break the behaviour of the application and the page is reloaded after every action.
I have tried to follow the sample code with advance callback, but that example do not use the update button to update the entire modified record. Something I did observed is that the cancel button is using rendered with the __doPostBack and the Update Button is rendered with the WebForm_DoPostBackWithOptions.
Please advise.
Thanks
|
|
Rank: Member Groups: Member
Joined: 7/1/2007 Posts: 17
|
I managed to get the WebResources.axd file downloaded with a hidden validator. There is no more javascript error complaining that WebForm_DoPostBackWithOptions is undefined, but at the same time no event is fired and the datagrid_update callback did not get called.
Is there anyway to debug this?
Thanks
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi Tommy,
Can you create a sample that demonstrates how you forced the WebResources.axd to be loaded and how it breaks our CallbackPanel so that we can take a look? It does not suppose to happen since CallbackPanel doesn't really care how you post back the page because it works on form.submit, not how you call form.submit, so if you see that, then it may be a bug.
I would not get obssessed with WebForm_DoPostBackWithOptions or __doPostBack because those are rendered by ASP.NET and we do not touch them. One way to verify this is by temporary disabling the callback (by clearing the Triggers property) and you will still see those show up.
Thanks
|
|
Rank: Member Groups: Member
Joined: 7/1/2007 Posts: 17
|
Thanks you so much for all the help.
I managed to get it working. I put a RequiredFieldValidator in but forgot to set a value in the textbox, once I put it a value in the PreRender callback. The application work seemlessly.
EO is really a great product. I manage to build a very interactive application running on a web browser.
Thanks again.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Very nice! Thanks for the update!
|
|