如题。

解决方案 »

  1.   

    使用母版页后很多javascript功能都不能正常使用。
      

  2.   

    一段上传图片前预览的代码,放在普通页里正常,使用母版页后就无法预览了。<%@ Page Language="C#" MasterPageFile="~/common/tx/tx2.master" AutoEventWireup="true" CodeFile="Default5.aspx.cs" Inherits="Default5" Title="Untitled Page" %><asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <script type="text/javascript">
    function a()
    {
     var o = document.getElementById("FileUpload1");
     var src = o.value
     var img = document.getElementById("img");
     if(src != "")
     {
      document.getElementById("img").src = src;
      
      img.width = 300;
      
     }
    }
    window.setInterval("a()",5000);
    </script>

     <div>
         <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
         </asp:ScriptManagerProxy>
        
         <asp:UpdatePanel ID="UpdatePanel1" runat="server">
             <ContentTemplate>
        <asp:FileUpload ID="FileUpload1" runat="server" Height="27px" Width="353px" />
                            <img id="img" src="/App_Images/yulan.png" />
             </ContentTemplate>
         </asp:UpdatePanel>
      
                                                    </div>
    </asp:Content>
      

  3.   

    使用母版后,一些服务器空间的ID就改变了,楼主可以试着打开页面然后查看源文件的。在JS里引用空间的时候在空间ID前加ctl00_ContentPlaceHolder1_