Hi,
this is currently not working because each namespace you define with
the AjaxNamespace attribute must be unique, this is by design. If your
controls are not change to much you can write your own JavaScript
wrapper file. I will show how to do this in a new thread.
Regards,
Michael
On 6/22/06, K. Ali Ulug <[EMAIL PROTECTED]> wrote:
>
> hello all,
>
> I have a web application in which there is only one aspx page and many
> user controls that are inserted into the page dynamically. I want to
> use the same client namespace for all ajax methods in the user controls
> by not forcing the developer to add additional code to his classes. To
> be clear I will give an example; below is the code for the main page
>
> public partial class _default : System.Web.UI.Page
> {
> ......................
> private void loadModule(string p)
> {
> ..................
> Control UIModule = Page.LoadControl("UIModules\\" +
> p.Replace("~", "\\") + ".ascx");
> lblInfo.Text = UIModule.ToString();
> plhMain.Controls.Add(UIModule);
> Utility.RegisterTypeForAjax(UIModule.GetType());
> .............
> }
> ......
> }
>
> Below is the ascx class;
>
> [AjaxNamespace("MyAjaxNS")]
> public partial class UIModuller_userControl1 :
> System.Web.UI.UserControl
> {
> ...........
> [AjaxMethod]
> public string MyAjaxMethod()
> {
> return "hi";
> }
> }
>
> With these, I can call an Ajax method which is implemented in
> userControl1 class, there is no problem (by calling
> MyAjaxNS.MyAjaxMethod in java script). But what I want is, not to force
> the developer to add AjaxNamespace attribute to all his classes in
> which he is using ajax. If one can show me the way how to achieve the
> same functionality by declaring the namespace in the main page
> (default.aspx in the above example) just for once, I will be glad :)
>
> Ali
>
>
> >
>
--
Best regards | Schöne Grüße
Michael
Microsoft MVP - Most Valuable Professional
Microsoft MCAD - Certified Application Developer
http://weblogs.asp.net/mschwarz/
http://www.schwarz-interactive.de/
mailto:[EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ajax.NET Professional" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/ajaxpro
The latest downloads of Ajax.NET Professional can be found at
http://www.ajaxpro.info
-~----------~----~----~----~------~----~------~--~---