fonts enlarge on postback

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BlackEye
    New Member
    • Jul 2008
    • 13

    fonts enlarge on postback

    hi

    everytime my .net page reloads after pressing a submit button, the fonts get enlarged. i dunno why this happens and how to check this

    can anyone pls help me on this...
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Are you using a style sheet?
    If so, are you dynamically adding the style sheet to the page?

    Comment

    • BlackEye
      New Member
      • Jul 2008
      • 13

      #3
      Originally posted by Frinavale
      Are you using a style sheet?
      If so, are you dynamically adding the style sheet to the page?
      thanx for replying

      no i'm not using any style sheets. i dont need them yet.

      its just a simple screen with labels, textboxes and a button.

      the problem remains

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        Originally posted by BlackEye
        thanx for replying

        no i'm not using any style sheets. i dont need them yet.

        its just a simple screen with labels, textboxes and a button.

        the problem remains
        Try applying a style to your page to fix the problem.
        If you don't know how to use CSS, w3c is a great resource to learn how to use it.

        -Frinny

        Comment

        • BlackEye
          New Member
          • Jul 2008
          • 13

          #5
          Originally posted by Frinavale
          Try applying a style to your page to fix the problem.
          If you don't know how to use CSS, w3c is a great resource to learn how to use it.

          -Frinny
          thanx for the suggestion...bu t i dont want to use style sheets right now and keep my application as simple as possible. i dont think such a problem should surface when style sheets are not in use. am i doing something wrong or is it possible that something could be wrong with my software?

          Comment

          • Frinavale
            Recognized Expert Expert
            • Oct 2006
            • 9749

            #6
            Originally posted by BlackEye
            everytime my .net page reloads after pressing a submit button, the fonts get enlarged.
            There could be a number of reasons for this...
            It could be your browser settings... it could be that you are displaying text in a Label in one area and in a Localize in another and your browser treats them differently.

            To make sure that your page is displayed the same all the time you should use css...it's as simple as: <asp:Label id="myLabel" runat="server" style="font-size:12px"></asp:Label>

            ....Does your text keep enlarging every time you post back??

            Comment

            • BlackEye
              New Member
              • Jul 2008
              • 13

              #7
              Originally posted by Frinavale
              There could be a number of reasons for this...
              It could be your browser settings... it could be that you are displaying text in a Label in one area and in a Localize in another and your browser treats them differently.

              To make sure that your page is displayed the same all the time you should use css...it's as simple as: <asp:Label id="myLabel" runat="server" style="font-size:12px"></asp:Label>

              ....Does your text keep enlarging every time you post back??

              The text size increases with the first postback. Then it remains large even after subsequent postbacks. The size does not increase further.

              Comment

              • Frinavale
                Recognized Expert Expert
                • Oct 2006
                • 9749

                #8
                Please post your ASP code responsible for displaying your text.

                -Frinny

                (PS. remember to use [code] tags when posting code snippets)

                Comment

                • BlackEye
                  New Member
                  • Jul 2008
                  • 13

                  #9
                  Originally posted by Frinavale
                  Please post your ASP code responsible for displaying your text.

                  -Frinny

                  (PS. remember to use code tags when posting code snippets)

                  if you are talking about the source code of the page, here it is:

                  Code:
                  <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="LoginScreen.aspx.cs" Inherits="_Default" %>
                  
                  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                  
                  <html xmlns="http://www.w3.org/1999/xhtml" >
                  <head runat="server">
                      <title>Login Page</title>
                  </head>
                  <body bgcolor="#a6d7ff">
                      <form id="form1" runat="server">
                      <div>
                          &nbsp;&nbsp;
                          <asp:Label ID="WelcomeLabel" runat="server" Font-Bold="True" Font-Italic="True" Font-Names="Times New Roman"
                              Font-Size="X-Large" Font-Underline="True" ForeColor="Navy" Style="z-index: 100;
                              left: 343px; position: absolute; top: 43px" Text="Welcome to Login Screen" Width="444px"></asp:Label>
                          <asp:Label ID="UserNameLabel" runat="server" Font-Bold="True" Font-Size="Large" ForeColor="Navy"
                              Style="z-index: 101; left: 324px; position: absolute; top: 214px" Text="User Name:" Width="130px"></asp:Label>
                          <asp:Label ID="PasswordLabel" runat="server" Font-Bold="True" Font-Size="Large" ForeColor="Navy"
                              Style="z-index: 102; left: 336px; position: absolute; top: 274px" Text="Password:" Width="115px"></asp:Label>
                          <asp:TextBox ID="UserNameTextbox" runat="server" BackColor="LightCyan" Style="z-index: 103; left: 460px; position: absolute; top: 213px"></asp:TextBox>
                          <asp:TextBox ID="PasswordTextbox" runat="server" BackColor="LightCyan" Style="z-index: 104;
                              left: 460px; position: absolute; top: 273px" TextMode="Password"></asp:TextBox>
                          <asp:RequiredFieldValidator ID="UserNameRequiredFieldValidator" runat="server" ControlToValidate="UserNameTextbox"
                              ErrorMessage="Name is Required" ForeColor="DarkRed" Style="z-index: 105; left: 632px;
                              position: absolute; top: 215px" Width="118px">*</asp:RequiredFieldValidator>
                          <asp:RequiredFieldValidator ID="PasswordRequiredFieldValidator" runat="server" ControlToValidate="PasswordTextbox"
                              ErrorMessage="Password is Required" ForeColor="DarkRed" Style="z-index: 106;
                              left: 632px; position: absolute; top: 275px" Width="132px">*</asp:RequiredFieldValidator>
                          <asp:ValidationSummary ID="ValidationSummary1" runat="server" ForeColor="DarkRed"
                              HeaderText="Please take care of the following errors:" Style="z-index: 107; left: 351px;
                              position: absolute; top: 400px" Width="241px" />
                          <asp:Button ID="LoginButton" runat="server" BackColor="LightSteelBlue" Height="27px"
                              Style="z-index: 108; left: 460px; position: absolute; top: 327px" Text="Login"
                              Width="50px" OnClick="LoginButton_Click" />
                          <asp:Label ID="InvalidUserLabel" runat="server" ForeColor="DarkRed" Style="z-index: 110;
                              left: 324px; position: absolute; top: 368px"></asp:Label>
                      
                      </div>
                      </form>
                  </body>
                  </html>
                  Last edited by Curtis Rutland; Jul 27 '08, 10:46 PM. Reason: the code tag in frinny's quote was messing up the formatting.

                  Comment

                  • Frinavale
                    Recognized Expert Expert
                    • Oct 2006
                    • 9749

                    #10
                    Try removing the Font-Names property from the labels and see if that makes a difference....

                    The only thing that comes to mind is that your validation is causing the change. The validators run some JavaScript that may be messing with your sizing/spacing on the page.

                    -Frinny

                    Comment

                    Working...