Is thereany documentation showing what is required to equip a server-side WebControl to work with AJAX.NET?
I have some VERY simple WebControls that fire "Click" events. One of them consistantly causes the entire page to refresh, while the other doesn't. But they are both doing the same thing. For some reason, one seems tonot work with AJAX.NET, while the other does. Both of them are wrapped inside an UpdatePanel and ContentTemplate - but behave differently under AJAX.NET. Mysterious.
I can't tell if the examples showing ScriptControlDescriptor.AddEvent are relevent for what I'm doing or not. This seems to be related to very specific client side javascript voodoo - I just want to have a generic control that can fire events that will postback to the code-behind (like a normal ASP.NET button, for example - I can drop one of these on a page, use the event, and it just works - but how to do this properly with a custom WebControl - RELIABLY?).
If there is a plain-jane, simple example of a WebControl and the proper way to have it fire events (__doPostBack) without causing the entire page to refresh, that would be VERY helpful.
Thanks.
There's lots of examples of how to do this outside the webcontrol, so to do it inside a webcontrol all you really have to do is embed the javascript in the assembly and make sure that it ends with the if(Sys && Sys.Application) Sys.Application.notifyScriptLoaded(); statement. The easiest way to wire up interaction between your C# class and the javascript is by following the pattern described in the tutorials on custom extenders. children of ScriptControl follow the same basic pattern.
I've looked at the examples. There are too many things illustrated just aren't exlained. Sorry. I just don't have time to read the "Gone With the Wind" to get an answer to a simple question.
Do I have to write special javascript beyond the standard "_doPostBack" to get a postback executed without causing a page update? Why does it work for an asp:Button without doing anything out of the ordinary? Is some kind of magic support wired into ASP.NET for the standard .NET controls?
SIMPLE QUESTION (YES/NO):
Can I write a WebControl that fires events - like I would for a NON-AJAX application - and have it work under AJAX.NET without refreshing the entire page?
I thought that any postbacks generated inside an UpdatePanel/ContentTemplate would be AUTOMATICALLY handled by AJAX.NET. This is what it says in the documentation. Is this true or no?
This is just a YES/NO question.
Thanks (frustrated - about to punt on AJAX.NET and just work with web callbacks...)
No comments:
Post a Comment