2016-09-29 2 views
0

나는을 사용하여 웹 사이트를 만들었습니다. 지금까지는 모든 것이 잘 돌아갔다. 하지만 마지막 페이지 은 내가 예상 한대로 동작하지 않습니다.. UI에는 드롭 다운 목록, 격자보기, 링크 버튼 및 축소 막대 내에 몇 개의 레이블이 있습니다. Gridview는 드롭 다운 목록의 선택에 따라 채워집니다. gridview에는 버튼이 있으며이를 클릭하면 특정 행과 관련된 데이터가 레이블로로드됩니다. 링크 버튼은 시스템에 대한 pdf 업로드를 보는 것입니다. 이 링크 버튼을 클릭하면 문제가 발생합니다.. 링크를 클릭하자마자 나는 글꼴 디자인, 격자 등의 크기를 변경합니다. 어떻게 그 일을 그만 두겠습니까?웹 페이지의 디자인이 런타임에 변경되는 이유는 무엇입니까?

참고 : C# 코드는 오류없이 작동합니다.
한 페이지에만이이 문제가 발생합니다.

이 여기

링크 버튼을 클릭하기 전에 링크 버튼 후 이미지를 클릭하는 내 영문 코드

<%@ Page Title="" Language="C#" MasterPageFile="~/CDDS_Master.Master" AutoEventWireup="true" 
 
    CodeBehind="agencyAdmin.aspx.cs" Inherits="Claim_Distribution_System.agencyAdmin" %> 
 

 
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> 
 
</asp:Content> 
 
<asp:Content ID="Content2" ContentPlaceHolderID="agency" runat="server"> 
 
    <link href="CSS/bootstrap.min.css" rel="stylesheet" type="text/css" /> 
 

 
    <script src="JS/jquery.min.js" type="text/javascript"></script> 
 

 
    <script src="JS/bootstrap.min.js" type="text/javascript"></script> 
 

 
</asp:Content> 
 
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> 
 
    <div id="div0" runat="server" style="width: 100%; height: auto; margin-top: 15px"> 
 
     <asp:Label ID="lblApp" runat="server" Text="Competition :" Style="margin-left: 14px; 
 
      margin-top: 5px"> 
 
     </asp:Label> 
 
     <asp:DropDownList ID="ddlComp" runat="server" Style="margin-top: 5px; margin-left: 5px; 
 
      width: 60%; height: auto" AutoPostBack="True" OnSelectedIndexChanged="ddlCompName_SelectedIndexChanged"> 
 
     </asp:DropDownList> 
 
    </div> 
 
    <div id="div1" style="width: 100%; height: auto; float: left; margin-left: 10px"> 
 
     <asp:GridView ID="grdSum" runat="server" Style="margin-top: 10px;" OnRowDataBound="grdSum_RowDataBound" 
 
      OnRowCreated="grdSum_RowCreated" OnSelectedIndexChanged="grdSum_SelectedIndexChanged" 
 
      CellPadding="4" ForeColor="#333333" GridLines="None" AutoGenerateColumns="false"> 
 
      <RowStyle BackColor="#FFFBD6" ForeColor="#333333" HorizontalAlign="Justify" /> 
 
      <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" /> 
 
      <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" /> 
 
      <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" /> 
 
      <HeaderStyle BackColor="#990000" ForeColor="White" Font-Bold="True" /> 
 
      <AlternatingRowStyle BackColor="White" /> 
 
      <Columns> 
 
       <asp:BoundField DataField="refer" HeaderText="REFERENCE NUMBER"> 
 
        <ItemStyle Width="200px"></ItemStyle> 
 
        <%--200--%> 
 
       </asp:BoundField> 
 
       <asp:BoundField DataField="BRANCH_CODE" HeaderText="BRANCH"> 
 
        <ItemStyle Width="70px"></ItemStyle> 
 
       </asp:BoundField> 
 
       <asp:BoundField DataField="SO_CODE" HeaderText="SO"> 
 
        <ItemStyle Width="100px"></ItemStyle> 
 
       </asp:BoundField> 
 
       <asp:BoundField DataField="APPEAL_CREATE_DATE" HeaderText="CREATE DATE"> 
 
        <ItemStyle Width="120px"></ItemStyle> 
 
       </asp:BoundField> 
 
       <asp:BoundField DataField="ATTACHMENT_UPLOAD" HeaderText="ATTACHMENT"> 
 
        <ItemStyle Width="100px"></ItemStyle> 
 
       </asp:BoundField> 
 
       <asp:ButtonField Text="Click To View" CommandName="Select"> 
 
        <ItemStyle Width="100px"></ItemStyle> 
 
       </asp:ButtonField> 
 
      </Columns> 
 
     </asp:GridView> 
 
     <asp:LinkButton ID="lnkDummy" runat="server"></asp:LinkButton> 
 
    </div> 
 
    <div id="emp" style="width: 100%; height: 20px; float: left"> 
 
    </div> 
 
    <div id="col" style="width: 100%; height: auto; margin-left: 5px; float: left"> 
 
     <div class="container"> 
 
      <div class="panel-group" id="accordion"> 
 
       <div class="panel panel-default"> 
 
        <div class="panel-heading"> 
 
         <h4 class="panel-title"> 
 
          <a data-toggle="collapse" data-parent="#accordion" href="#collapse1">Basic Appeal Info</a> 
 
         </h4> 
 
        </div> 
 
        <div id="collapse1" class="panel-collapse collapse in"> 
 
         <div class="panel-body"> 
 
          <div id="col1Body" style="width: 95%; height: auto;"> 
 
           <div id="inner1" style="width: 98%; height: auto; float: left"> 
 
            <asp:Label ID="Label1" runat="server" Style="width: 35%; margin-left: 43px" Text="Reference No :"></asp:Label> 
 
            <asp:Label ID="lblRef" runat="server" Style="width: 90%; margin-left: 10px" Text="Reference No :"></asp:Label> 
 
           </div> 
 
           <div id="inner2" style="width: 98%; height: auto; float: left; margin-top: 10px"> 
 
            <asp:Label ID="Label2" runat="server" Style="width: 35%; margin-left: 20px" Text="Competion Name :"></asp:Label> 
 
            <asp:Label ID="lblComName" runat="server" Style="width: 90%; margin-left: 10px" Text="Reference No :"></asp:Label> 
 
           </div> 
 
           <div id="inner3" style="width: 98%; height: auto; float: left; margin-top: 10px"> 
 
            <asp:Label ID="Label3" runat="server" Style="width: 35%; margin-left: 48px" Text="Branch Code :"></asp:Label> 
 
            <asp:Label ID="lblBranch" runat="server" Style="width: 90%; margin-left: 10px" Text="Reference No :"></asp:Label> 
 
           </div> 
 
           <div id="inner4" style="width: 98%; height: auto; float: left; margin-top: 10px"> 
 
            <asp:Label ID="Label4" runat="server" Style="width: 35%; margin-left: 72px" Text="SO Code :"></asp:Label> 
 
            <asp:Label ID="lblSo" runat="server" Style="width: 90%; margin-left: 10px" Text="Reference No :"></asp:Label> 
 
           </div> 
 
           <div id="inner5" style="width: 98%; height: auto; float: left; margin-top: 10px"> 
 
            <asp:Label ID="Label6" runat="server" Style="width: 35%; margin-left: 74px" Text="Remarks :"></asp:Label> 
 
            <asp:Label ID="lblRemarks" runat="server" Style="width: 90%; height: auto; text-align: justify; 
 
             margin-left: 10px;" Text="Reference No :"></asp:Label> 
 
           </div> 
 
           <div id="inner6" style="width: 80%; height: auto; float: left; margin-top: 10px; 
 
            margin-left: 10%; margin-bottom: 10px"> 
 
            <div id="inner61" style="width: 30%; height: auto; float: left; margin-left: 100px"> 
 
             <asp:GridView ID="grdKPI" runat="server" Style="margin-left: 5px; margin-top: 5px; 
 
              margin-bottom: 10px; float: left; border-color: #9B0423; border-width: medium; 
 
              width: 50%; text-align: center;" OnRowDataBound="grdKPI_RowDataBound"> 
 
              <HeaderStyle BackColor="#9B0423" ForeColor="White" /> 
 
              <AlternatingRowStyle BackColor="#FFE6E6" /> 
 
             </asp:GridView> 
 
            </div> 
 
            <div id="inner62" style="width: 30%; height: auto; float: left; margin-left: 10px"> 
 
             <asp:GridView ID="grdPolicyDetails" runat="server" Style="margin-top: 5px; margin-bottom: 10px; 
 
              float: left; border-color: #9B0423; border-width: medium; width: 50%; text-align: center" 
 
              OnRowDataBound="grdPolicyDetails_RowDataBound"> 
 
              <HeaderStyle BackColor="#9B0423" ForeColor="White" /> 
 
              <AlternatingRowStyle BackColor="#FFE6E6" /> 
 
             </asp:GridView> 
 
            </div> 
 
           </div> 
 
           <div id="empty" style="width: 100%; height: auto; float: left"> 
 
            <asp:Label ID="Label8" runat="server" Style="width: 35%; margin-left: 25px" Text="View Attachment :"></asp:Label> 
 
            <asp:LinkButton ID="pdfViewAdmin" runat="server" Style="margin-left: 10px" OnClick="pdfViewAdmin_Click">View PDF</asp:LinkButton> 
 
           </div> 
 
          </div> 
 
         </div> 
 
        </div> 
 
       </div> 
 
       <div class="panel panel-default"> 
 
        <div class="panel-heading"> 
 
         <h4 class="panel-title"> 
 
          <a data-toggle="collapse" data-parent="#accordion" href="#collapse2">LOP</a> 
 
         </h4> 
 
        </div> 
 
        <div id="collapse2" class="panel-collapse collapse"> 
 
         <div class="panel-body"> 
 
          <div id="colBody2" style="width: 95%; height: auto;"> 
 
           <div id="inner7" style="width: 98%; height: auto;"> 
 
            <asp:Label ID="Label5" runat="server" Style="width: 35%; margin-left: 43px" Text="Remarks :"></asp:Label> 
 
            <asp:Label ID="lblRemarksLOP" runat="server" Style="width: 90%; margin-left: 10px" 
 
             Text="Reference No :"></asp:Label> 
 
           </div> 
 
          </div> 
 
         </div> 
 
        </div> 
 
        <div class="panel panel-default"> 
 
         <div class="panel-heading"> 
 
          <h4 class="panel-title"> 
 
           <a data-toggle="collapse" data-parent="#accordion" href="#collapse3">Accountant</a> 
 
          </h4> 
 
         </div> 
 
         <div id="collapse3" class="panel-collapse collapse"> 
 
          <div class="panel-body"> 
 
           <div id="colBody3" style="width: 95%; height: auto;"> 
 
            <div id="inner8" style="width: 98%; height: auto;"> 
 
             <asp:Label ID="Label7" runat="server" Style="width: 35%; margin-left: 43px" Text="Remarks :"></asp:Label> 
 
             <asp:Label ID="lblRemarksAcc" runat="server" Style="width: 90%; margin-left: 10px" 
 
              Text="Reference No :"></asp:Label> 
 
            </div> 
 
           </div> 
 
          </div> 
 
         </div> 
 
        </div> 
 
       </div> 
 
      </div> 
 
     </div> 
 
    </div> 
 
</asp:Content>
입니다
before click

after click

변화에 따라

링크 버튼을 클릭 이벤트

protected void pdfViewAdmin_Click(object sender, EventArgs e) 
{ 
    Response.Write(string.Format("<script>window.open('{0}','_blank');</script>", "viewPDF.aspx")); 
    lblComName.Visible = true; 
    lblBranch.Visible = true; 
    lblSo.Visible = true; 
} 
+0

를 발견 한 곳
이는 방법'pdfViewAdmin_Click'을 보여줄 수있다? 또는 OnClick = "pdfViewAdmin_Click"을 아무런 작동도하지 않는 일부 enother 메소드로 변경하면 동작이 변경됩니까? – Fabio

+0

@Fabio, 나는 pdfViewAdmin_Click 내부의 코드에 주석을 달고 링크 버튼을 클릭했다. 디자인이 바뀌지 않았습니다. – Mike

+0

자, 이제 pdfViewAdmin_Click 코드를 추가하겠습니다. 잠시 후 질문을 확인하십시오. – Mike

답변

0

내 문제를 해결했다.

protected void pdfViewAdmin_Click(object sender, EventArgs e) 
{ 
     //Response.Write(string.Format("<script>window.open('{0}','_blank');</script>", "viewPDF.aspx")); 
     this.ClientScript.RegisterStartupScript(this.GetType(), this.GetType().Name, string.Format("window.open('{0}', '_blank');", "viewPDF.aspx"), true); 
     lblComName.Visible = true; 
     lblBranch.Visible = true; 
     lblSo.Visible = true; 
     lblRef.Visible = true; 
     lblRemarks.Visible = true; 
}   

주석 처리 된 줄은 이전에 작성한 코드입니다. 그 아래의 줄은 새로운 코드이며 작동했습니다. 내가 대답
Click to view the page

관련 문제