title: Why does the design of a web page change at run time?
body: <p>I have created a <strong>website using asp.net</strong>. Everything worked fine until now. But the last page <strong>does not behave as i expected</strong>. In the UI there is a dropdownlist,gridview,link button and few labels within a collapse bar. Gridview get populated according to the selection of the dropdownlist. In the gridview there is a button and when clicked it, data relevant to the specific row loads into labels. Link button is to view a pdf upload to the system. <strong>Problem occurs when click on this link button</strong>. As soon as I c<strong>lick on the link button design changes its size of fonts,grid etc</strong>. How to stop happening it?      </p>
  
  <blockquote>
    <p>Note : C# code works without any error.<br>
             This problem occurs only in <strong>one page</strong>.</p>
  </blockquote>
  
  <p>This is my aspx code       </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;%@ Page Title="" Language="C#" MasterPageFile="~/CDDS_Master.Master" AutoEventWireup="true"
      CodeBehind="agencyAdmin.aspx.cs" Inherits="Claim_Distribution_System.agencyAdmin" %&gt;
  
  &lt;asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"&gt;
  &lt;/asp:Content&gt;
  &lt;asp:Content ID="Content2" ContentPlaceHolderID="agency" runat="server"&gt;
      &lt;link href="CSS/bootstrap.min.css" rel="stylesheet" type="text/css" /&gt;
  
      &lt;script src="JS/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt;
  
      &lt;script src="JS/bootstrap.min.js" type="text/javascript"&gt;&lt;/script&gt;
  
  &lt;/asp:Content&gt;
  &lt;asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"&gt;
      &lt;div id="div0" runat="server" style="width: 100%; height: auto; margin-top: 15px"&gt;
          &lt;asp:Label ID="lblApp" runat="server" Text="Competition :" Style="margin-left: 14px;
              margin-top: 5px"&gt;
          &lt;/asp:Label&gt;
          &lt;asp:DropDownList ID="ddlComp" runat="server" Style="margin-top: 5px; margin-left: 5px;
              width: 60%; height: auto" AutoPostBack="True" OnSelectedIndexChanged="ddlCompName_SelectedIndexChanged"&gt;
          &lt;/asp:DropDownList&gt;
      &lt;/div&gt;
      &lt;div id="div1" style="width: 100%; height: auto; float: left; margin-left: 10px"&gt;
          &lt;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"&gt;
              &lt;RowStyle BackColor="#FFFBD6" ForeColor="#333333" HorizontalAlign="Justify" /&gt;
              &lt;FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" /&gt;
              &lt;PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" /&gt;
              &lt;SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" /&gt;
              &lt;HeaderStyle BackColor="#990000" ForeColor="White" Font-Bold="True" /&gt;
              &lt;AlternatingRowStyle BackColor="White" /&gt;
              &lt;Columns&gt;
                  &lt;asp:BoundField DataField="refer" HeaderText="REFERENCE NUMBER"&gt;
                      &lt;ItemStyle Width="200px"&gt;&lt;/ItemStyle&gt;
                      &lt;%--200--%&gt;
                  &lt;/asp:BoundField&gt;
                  &lt;asp:BoundField DataField="BRANCH_CODE" HeaderText="BRANCH"&gt;
                      &lt;ItemStyle Width="70px"&gt;&lt;/ItemStyle&gt;
                  &lt;/asp:BoundField&gt;
                  &lt;asp:BoundField DataField="SO_CODE" HeaderText="SO"&gt;
                      &lt;ItemStyle Width="100px"&gt;&lt;/ItemStyle&gt;
                  &lt;/asp:BoundField&gt;
                  &lt;asp:BoundField DataField="APPEAL_CREATE_DATE" HeaderText="CREATE DATE"&gt;
                      &lt;ItemStyle Width="120px"&gt;&lt;/ItemStyle&gt;
                  &lt;/asp:BoundField&gt;
                  &lt;asp:BoundField DataField="ATTACHMENT_UPLOAD" HeaderText="ATTACHMENT"&gt;
                      &lt;ItemStyle Width="100px"&gt;&lt;/ItemStyle&gt;
                  &lt;/asp:BoundField&gt;
                  &lt;asp:ButtonField Text="Click To View" CommandName="Select"&gt;
                      &lt;ItemStyle Width="100px"&gt;&lt;/ItemStyle&gt;
                  &lt;/asp:ButtonField&gt;
              &lt;/Columns&gt;
          &lt;/asp:GridView&gt;
          &lt;asp:LinkButton ID="lnkDummy" runat="server"&gt;&lt;/asp:LinkButton&gt;
      &lt;/div&gt;
      &lt;div id="emp" style="width: 100%; height: 20px; float: left"&gt;
      &lt;/div&gt;
      &lt;div id="col" style="width: 100%; height: auto; margin-left: 5px; float: left"&gt;
          &lt;div class="container"&gt;
              &lt;div class="panel-group" id="accordion"&gt;
                  &lt;div class="panel panel-default"&gt;
                      &lt;div class="panel-heading"&gt;
                          &lt;h4 class="panel-title"&gt;
                              &lt;a data-toggle="collapse" data-parent="#accordion" href="#collapse1"&gt;Basic Appeal Info&lt;/a&gt;
                          &lt;/h4&gt;
                      &lt;/div&gt;
                      &lt;div id="collapse1" class="panel-collapse collapse in"&gt;
                          &lt;div class="panel-body"&gt;
                              &lt;div id="col1Body" style="width: 95%; height: auto;"&gt;
                                  &lt;div id="inner1" style="width: 98%; height: auto; float: left"&gt;
                                      &lt;asp:Label ID="Label1" runat="server" Style="width: 35%; margin-left: 43px" Text="Reference No :"&gt;&lt;/asp:Label&gt;
                                      &lt;asp:Label ID="lblRef" runat="server" Style="width: 90%; margin-left: 10px" Text="Reference No :"&gt;&lt;/asp:Label&gt;
                                  &lt;/div&gt;
                                  &lt;div id="inner2" style="width: 98%; height: auto; float: left; margin-top: 10px"&gt;
                                      &lt;asp:Label ID="Label2" runat="server" Style="width: 35%; margin-left: 20px" Text="Competion Name :"&gt;&lt;/asp:Label&gt;
                                      &lt;asp:Label ID="lblComName" runat="server" Style="width: 90%; margin-left: 10px" Text="Reference No :"&gt;&lt;/asp:Label&gt;
                                  &lt;/div&gt;
                                  &lt;div id="inner3" style="width: 98%; height: auto; float: left; margin-top: 10px"&gt;
                                      &lt;asp:Label ID="Label3" runat="server" Style="width: 35%; margin-left: 48px" Text="Branch Code :"&gt;&lt;/asp:Label&gt;
                                      &lt;asp:Label ID="lblBranch" runat="server" Style="width: 90%; margin-left: 10px" Text="Reference No :"&gt;&lt;/asp:Label&gt;
                                  &lt;/div&gt;
                                  &lt;div id="inner4" style="width: 98%; height: auto; float: left; margin-top: 10px"&gt;
                                      &lt;asp:Label ID="Label4" runat="server" Style="width: 35%; margin-left: 72px" Text="SO Code :"&gt;&lt;/asp:Label&gt;
                                      &lt;asp:Label ID="lblSo" runat="server" Style="width: 90%; margin-left: 10px" Text="Reference No :"&gt;&lt;/asp:Label&gt;
                                  &lt;/div&gt;
                                  &lt;div id="inner5" style="width: 98%; height: auto; float: left; margin-top: 10px"&gt;
                                      &lt;asp:Label ID="Label6" runat="server" Style="width: 35%; margin-left: 74px" Text="Remarks :"&gt;&lt;/asp:Label&gt;
                                      &lt;asp:Label ID="lblRemarks" runat="server" Style="width: 90%; height: auto; text-align: justify;
                                          margin-left: 10px;" Text="Reference No :"&gt;&lt;/asp:Label&gt;
                                  &lt;/div&gt;
                                  &lt;div id="inner6" style="width: 80%; height: auto; float: left; margin-top: 10px;
                                      margin-left: 10%; margin-bottom: 10px"&gt;
                                      &lt;div id="inner61" style="width: 30%; height: auto; float: left; margin-left: 100px"&gt;
                                          &lt;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"&gt;
                                              &lt;HeaderStyle BackColor="#9B0423" ForeColor="White" /&gt;
                                              &lt;AlternatingRowStyle BackColor="#FFE6E6" /&gt;
                                          &lt;/asp:GridView&gt;
                                      &lt;/div&gt;
                                      &lt;div id="inner62" style="width: 30%; height: auto; float: left; margin-left: 10px"&gt;
                                          &lt;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"&gt;
                                              &lt;HeaderStyle BackColor="#9B0423" ForeColor="White" /&gt;
                                              &lt;AlternatingRowStyle BackColor="#FFE6E6" /&gt;
                                          &lt;/asp:GridView&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                                  &lt;div id="empty" style="width: 100%; height: auto; float: left"&gt;
                                      &lt;asp:Label ID="Label8" runat="server" Style="width: 35%; margin-left: 25px" Text="View Attachment :"&gt;&lt;/asp:Label&gt;
                                      &lt;asp:LinkButton ID="pdfViewAdmin" runat="server" Style="margin-left: 10px" OnClick="pdfViewAdmin_Click"&gt;View PDF&lt;/asp:LinkButton&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class="panel panel-default"&gt;
                      &lt;div class="panel-heading"&gt;
                          &lt;h4 class="panel-title"&gt;
                              &lt;a data-toggle="collapse" data-parent="#accordion" href="#collapse2"&gt;LOP&lt;/a&gt;
                          &lt;/h4&gt;
                      &lt;/div&gt;
                      &lt;div id="collapse2" class="panel-collapse collapse"&gt;
                          &lt;div class="panel-body"&gt;
                              &lt;div id="colBody2" style="width: 95%; height: auto;"&gt;
                                  &lt;div id="inner7" style="width: 98%; height: auto;"&gt;
                                      &lt;asp:Label ID="Label5" runat="server" Style="width: 35%; margin-left: 43px" Text="Remarks :"&gt;&lt;/asp:Label&gt;
                                      &lt;asp:Label ID="lblRemarksLOP" runat="server" Style="width: 90%; margin-left: 10px"
                                          Text="Reference No :"&gt;&lt;/asp:Label&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="panel panel-default"&gt;
                          &lt;div class="panel-heading"&gt;
                              &lt;h4 class="panel-title"&gt;
                                  &lt;a data-toggle="collapse" data-parent="#accordion" href="#collapse3"&gt;Accountant&lt;/a&gt;
                              &lt;/h4&gt;
                          &lt;/div&gt;
                          &lt;div id="collapse3" class="panel-collapse collapse"&gt;
                              &lt;div class="panel-body"&gt;
                                  &lt;div id="colBody3" style="width: 95%; height: auto;"&gt;
                                      &lt;div id="inner8" style="width: 98%; height: auto;"&gt;
                                          &lt;asp:Label ID="Label7" runat="server" Style="width: 35%; margin-left: 43px" Text="Remarks :"&gt;&lt;/asp:Label&gt;
                                          &lt;asp:Label ID="lblRemarksAcc" runat="server" Style="width: 90%; margin-left: 10px"
                                              Text="Reference No :"&gt;&lt;/asp:Label&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/asp:Content&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Here are images before the link button click and after link button click<br>
  <a href="https://i.stack.imgur.com/KSO9o.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KSO9o.jpg" alt="before click"></a></p>
  
  <p><a href="https://i.stack.imgur.com/ruoSt.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ruoSt.jpg" alt="after click"></a></p>
  
  <p>Link button click event     </p>
  
  <pre><code>protected void pdfViewAdmin_Click(object sender, EventArgs e)
  {
       Response.Write(string.Format("&lt;script&gt;window.open('{0}','_blank');&lt;/script&gt;", "viewPDF.aspx"));
       lblComName.Visible = true;
       lblBranch.Visible = true;
       lblSo.Visible = true;
  }
  </code></pre>