日期:2014-05-18  浏览次数:20440 次

vs2005 没有AJAX母板页
我先是在官方下载安装了ASP.NET AJAX 1.0 后来又下载了AJAX Control Toolkit 也在工具栏导入了AjaxControlToolkit.dll

虽然控件都有了,但是新建页的时候,没有AJAX页,我在普通页里面放置了 AJAX控件也没有效果。也不知道我是没有装好还是代码没有写好。下面是代码:

HTML code

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TagDetail.aspx.cs" Inherits="com.rms.web.recipt.TagDetail" MasterPageFile="~/master/BaseEdit.Master" %>

<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<asp:Content ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script type="text/javascript" language="javascript">
       function ShowNo()                        //隐藏两个层
       {
           document.getElementById("doing").style.display="none";
           document.getElementById("divLogin").style.display="none";
       }
       function $(id)          
       {
           return (document.getElementById) ? document.getElementById(id) : document.all[id] ;
       }
       function showFloat()                    //根据屏幕的大小显示两个层
       {
           var range = getRange();
           $('doing').style.width = range.width + "px";
           $('doing').style.height = range.height + "px";
           $('doing').style.display = "block";
           document.getElementById("divLogin").style.display="";
       }
       function getRange()                      //得到屏幕的大小
       {
             var top    = document.body.scrollTop;
             var left    = document.body.scrollLeft;
             var height = document.body.clientHeight;
             var width  = document.body.clientWidth;

             if (top==0 && left==0 && height==0 && width==0)  
             {
               top    = document.documentElement.scrollTop;
               left    = document.documentElement.scrollLeft;
               height = document.documentElement.clientHeight;
               width  = document.documentElement.clientWidth;
             }
             return {top:top ,left:left ,height:height ,width:width } ;
       }  
   </script>

    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table>
    <tr>
        <td>
            &nbsp; &nbsp; &nbsp; &nbsp; 变量编号:</td>
        <td style="width: 80px"><asp:TextBox ID="txt_TagID" runat="server" Width="85px"></asp:TextBox></td>
        <td>变量名称:</td>
        <td style="width: 221px"><asp:TextBox ID="txt_TagName" runat="server" Width="213px"></asp:TextBox></td>
    </tr>
    <tr>
        <td>OPC变量地址:</td>
        <td>
            <asp:TextBox ID="txt_OPCTag" runat="server"></asp:TextBox><asp:Button ID="btn_OPCTag"
                runat="server" Text="选择" OnClick="btn_OPCTag_Click" /></td>
        <td>数据单位:</td>
         <td><asp:TextBox ID="txt_Tag_UnitName" runat="server" Width="213px"></asp:TextBox></td>
    </tr>
    <tr>
        <td>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 备注:</td>
        <td colspan="3"><asp:TextBox ID="txt_R