当前位置:编程学习 > C#/ASP.NET >>

AjaxPro初学者的问题

已经修改了web.config,贴出代码:
<%@ Page Language="VB" Debug="true"%>
<%@ Register TagPrefix="AjaxPro" Namespace="AjaxPro" Assembly="AjaxPro" %>
<script language="VB" runat="server">
Sub Page_Load(sender as object, e as eventargs)
If not Page.IsPostBack then
'页面第一次载入
AjaxPro.Utility.RegisterTypeForAjax(WebForm1.gettype,me)
end if
End Sub

<AjaxPro.AjaxMethod>Function GetCustomerMac(clientIP As String) As String
GetCustomerMac=clientIP
End Function
</script>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script type="text/javascript">
function GetMac()
{
alert(WebForm1.GetCustomerMac('172.16.90.197').value);
}
</script>
</head>
<body bgcolor=#FFFFFF>
<FORM id="WebForm1" runat="server">
<INPUT style="Z-INDEX: 101; LEFT: 392px; POSITION: absolute; TOP: 176px" 
type="button"  value="客户端获取IP" onclick="javascript:GetMac();">
</form>
</body>
</html>
执行后按按钮显示对象不支持此属性或方法 --------------------编程问答-------------------- 大家帮忙看看吧. --------------------编程问答-------------------- 开始-运行 输入regsvr32 jscript.dll 确定 
再输入regsvr32 vbscript.dll 确定 
试一下 --------------------编程问答-------------------- 试过了,还是报"对象不支持此属性或方法" --------------------编程问答-------------------- onclick="GetMac()" --------------------编程问答-------------------- 你先把js调试关了,看看还有没有这个问题。
就是页面属性--〉高级--〉js调试 --------------------编程问答-------------------- onclick="GetMac()"也不管用 --------------------编程问答--------------------

<%@ Page Language="VB" Debug="true"%> 
<%@ Register TagPrefix="AjaxPro" Namespace="AjaxPro" Assembly="AjaxPro" %> 
<script language="VB" runat="server"> 
Sub Page_Load(sender as object, e as eventargs) 
If not Page.IsPostBack then 
'页面第一次载入 
AjaxPro.Utility.RegisterTypeForAjax(WebForm1.gettype,me) 
end if 
End Sub 

<AjaxPro.AjaxMethod>Function GetCustomerMac(clientIP As String) As String 
GetCustomerMac=clientIP 
End Function 
</script> 
<html> 
<head> 
<title> </title> 
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
<script type="text/javascript"> 
function GetMac() 

alert(WebForm1.GetCustomerMac('172.16.90.197').value); 

</script> 
</head> 
<body bgcolor=#FFFFFF> 
<FORM id="WebForm1" runat="server"> 
<INPUT style="Z-INDEX: 101; LEFT: 392px; POSITION: absolute; TOP: 176px"  
type="button"  value="客户端获取IP" onclick="javascript:GetMac();"> 
</form> 
</body> 
</html> 
--------------------编程问答-------------------- 怎么不变色,我以为看起来会方便些! --------------------编程问答-------------------- 大哥,你贴出来的代码没改过吧. --------------------编程问答-------------------- 高手来帮忙看看吧. --------------------编程问答-------------------- 高手来帮忙看看吧. --------------------编程问答-------------------- WebForm1没有GetCustomerMac()这个属性或方法 --------------------编程问答-------------------- 不懂 --------------------编程问答-------------------- 不会,帮顶 --------------------编程问答-------------------- 学这东西没什么含意
直接学学最底层Ajax  最有用
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,