2013-09-26 4 views
1

이상한 문제가 있습니다. asp.net에서 제로 클립 보드를 구현하고 있습니다.버튼을 클릭하면 페이지가 다시로드됩니다.

먼저 사이트 마스터가없는 페이지를 만들고 제로 클립 보드를 구현했는데 완벽하게 작동했습니다.

다음은 코드입니다.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="Locker.test" %> 

     <!DOCTYPE html> 

     <html xmlns="http://www.w3.org/1999/xhtml"> 
     <head runat="server"> 
      <title></title> 

     </head> 
     <body> 
      <form id="form1" runat="server"> 
      <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> 
      <asp:Button ID="Button1" runat="server" Text="Button" />  
      </form> 

        <script type="text/javascript" src="Scripts/jquery-1.9.1.js"></script> 
        <script type="text/javascript" src="Scripts/jquery.zclip.js"></script> 
        <script type="text/javascript" src="Scripts/jquery.zclip.min.js"></script> 
         <script> 
          $(document).ready(function() { 
           $('#<%=Button1.ClientID%>').zclip({ 
            path: 'ZeroClipboard.swf', 
            copy: function() { return $('#<%=TextBox1.ClientID%>').val(); } 
           }); 
          }); 
         </script> 
     </body> 
     </html> 

이제 마스터 페이지를 사용하는 페이지에서이 동일한 코드를 구현하면 작동하지 않습니다. 그것은 자바 스크립트가 실행되지 않도록 내가 다시 게시물을 계산 트리거합니다.

autopost가 true인지 확인했지만 false로 설정되었습니다.

나는 무엇이 이것을 일으키는 지 잘 모르겠다.

도움이 될 것입니다.

다음은 마스터 페이지를 사용하는 페이지의 코드입니다. 당신이 다시 게시를 방지하려면

<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="searchResult.aspx.cs" Inherits="Locker.searchResult" %> 
    <asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server"> 
     <style type="text/css"> 
      .auto-style1 { 
       color: #FFFFFF; 
       font-size: large; 
      } 
      .auto-style2 { 
       color: #000000; 
      } 
      .auto-style3 { 
       color: #000000; 
       font-size: large; 
      } 
     </style> 
    </asp:Content> 

    <asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server"> 

      &nbsp;<p> 

      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<p> 
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong> <span class="auto-style3">Information</span><span class="auto-style1">&nbsp;&nbsp;&nbsp;</span></strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      <div style="width:70%; margin: auto auto; text-align:left;"> 
       <asp:Panel ID="Panel1" runat="server"> 
       <br /> 
       &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:Label ID="Label4" runat="server" style="font-weight: 700; font-size: large" Text="Details for :" CssClass="auto-style2"></asp:Label> 
       <asp:Label ID="Label5" runat="server" style="font-weight: 700; font-size: large; color: #0000FF"></asp:Label> 
       <br /> 
       <br /> 
       &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:Label ID="Label1" runat="server" Font-Bold="False" style="font-weight: 700; font-size: large" Text="Password :" CssClass="auto-style2"></asp:Label> 
       &nbsp;<asp:TextBox ID="TextBox2" runat="server" BorderStyle="Solid" Enabled="False" Font-Size="Medium" ForeColor="Black" Width="213px"></asp:TextBox> 

        &nbsp;<asp:Button ID="Button3" runat="server" Text="Button" /> 
        <input type="text" id="test_description" value="hi" /> 

       <script type="text/javascript" src="Scripts/jquery-1.9.1.js"></script> 
       <script type="text/javascript" src="Scripts/jquery.zclip.js"></script> 
       <script type="text/javascript" src="Scripts/jquery.zclip.min.js"></script> 
        <script> 
         $(document).ready(function() { 
          $('#<%=Button3.ClientID%>').zclip({ 
           path: 'ZeroClipboard.swf', 
           copy: function() { return $('#<%=TextBox2.ClientID%>').val(); } 
          }); 
         }); 
        </script> 
       <br /> 
       <br /> 
       &nbsp;&nbsp;&nbsp;&nbsp; &nbsp; 
       <asp:Label ID="Label6" runat="server" style="font-weight: 700; font-size: large" Text="Description :" CssClass="auto-style2"></asp:Label> 
       &nbsp;<asp:TextBox ID="TextBox5" runat="server" BorderStyle="Solid" Enabled="False" Font-Size="Medium" Height="48px" TextMode="MultiLine" Width="213px"></asp:TextBox> 
       <br /> 
       <br /> 
       &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
       <asp:Label ID="Label7" runat="server" style="font-weight: 700; font-size: small" Text="Last Editor was " CssClass="auto-style2"></asp:Label> 
       <asp:Label ID="Label8" runat="server" style="font-weight: 700; font-size: small" CssClass="auto-style2"></asp:Label> 
       <br /> 
       &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
       <br /> 
       &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
       <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Edit" Width="97px" /> 
       <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="Update" Visible="False" Width="97px" /> 
       <br /> 
       &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
       <br /> 
       &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
       <asp:Label ID="Label12" runat="server" style="font-weight: 700; font-size: large; color: #0000FF" Visible="False"></asp:Label> 
       <br /> 
       <br /> 
       <br /> 
       <br /> 
       &nbsp;&nbsp;&nbsp;&nbsp; 
     </asp:Panel> 

      </div> 
    </asp:Content> 
+0

당신이 브라우저 오류 콘솔 –

+0

에서 오류를 얻고있다 참조하여 버튼에 falseUseSubmitBehavior을 설정할 수 있습니다 그 페이지 –

답변

관련 문제