[Little note, I wrote hml transitional 4.01: I was wrong: it is xhtml 1.0 transitional] Ok, Thanks for the script, but our pages heavily rely upon dhtml and forms, as we are working with old asp.net code, we can't refactor it now. However, it seems that the form is rendered even though it shouldn't: this is the testing masterpage: pay attention. the form is named form1
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="GeneralAJAX.master.cs" Inherits="GeneralAJAX" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <asp:contentplaceholder id="pagecontent" runat="server"> </asp:contentplaceholder> </div> </form> </body> </html> then this is the testing page: (aspx) <%@ Page Language="C#" AutoEventWireup="true" CodeFile="testajax3.aspx.cs" Inherits="testajax3" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> <script type="text/javascript" src="scripts/wui.js"></script> <script type="text/javascript" src="scripts/wsel.js"></script> </head> <body> <form id="form1" runat="server"> <div> <script type="text/javascript" language="javascript"> function GetServerTime() { //alert("calling"); AJAXInterop.GetServerTime(GetServerTime_callback); // asynchronous call } function GetServerTime_callback(res) { alert(res.value); } GetServerTime(); </script> </div> </form> </body> </html> and code behind: using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class testajax3 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { AjaxPro.Utility.RegisterTypeForAjax(typeof(AJAXInterop)); } } note that the ajax part is omitted as it works. if you retrieve the page, you will notice that the aspnet form is rendered with name aspnetForm which wasn't required: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head><title> Untitled Page </title></head> <body> <form name="aspnetForm" method="post" action="testajax2.aspx" id="aspnetForm"> <div> <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTEwMDUyNjYzMjhkZKja5ZHDZO9y8ETy+xxM6HAkmTGi" /> </div> <script type="text/javascript" src="/WebUI/ajaxpro/prototype.ashx"></script> <script type="text/javascript" src="/WebUI/ajaxpro/core.ashx"></script> <script type="text/javascript" src="/WebUI/ajaxpro/converter.ashx"></script> <script type="text/javascript" src="/WebUI/ajaxpro/AJAXInterop,App_Code.ashx"></script> <div> <form id="aaaaaaaa" action=testajax3.aspx> <input type="text" id="ton" /> </form> <script type="text/javascript" language="javascript"> function GetServerTime() { alert("calling"); AJAXInterop.GetServerTime(GetServerTime_callback); // asynchronous call return false; } function GetServerTime_callback(res) { alert(res.value); } </script> <a onclick="GetServerTime()">Test me!</a> </div> </form> </body> </html> The validator, obvioulsy: form should be nested, Some tag can not be contained in themselve. For ex, a FORM tag in a FORM tag. for this reason we had stripped out the form. Thanks in advance, Pier --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
