I tried to build a test application for calling a server side method
out of javascript but it just doesn't work. It seems to me it doesn't
register the type for callback. I setup the web.config, like the quick
sample, too.
Can anybody provide a simple example how to do this?
I tried the following:
namespace test
{
public partial class treelist : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
HtmlImage image = new HtmlImage();
image.Src = "http://www.golem.de/_img/logo_bottom.gif";
image.Attributes["OnClick"] = "test.treelist.Expand(4,
Expand_callback)";
ClientScript.RegisterClientScriptBlock(GetType(),
"expandcallback", "function
Expand_callback(result){alert(result.value}}", true);
form1.Controls.Add(image);
Utility.RegisterTypeForAjax(GetType());
}
[AjaxMethod]
public String Expand(int recId)
{
return "blub";
}
}
}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---