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
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---