Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    $object->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Jun 2003
    Posts
    3,100
    Thanks
    2
    Thanked 23 Times in 23 Posts

    Form won't center: ASP.NET problem?

    I started a thread about this problem here in the HTML & CSS forum because at the time this seemed more like a CSS problem than one with .NET. Now I'm starting to wonder.

    To repeat just a small part of the discussion from that other thread, I have the following in my CSS to center my form:

    Code:
    .center_it {
    	margin: 0 auto;
    }
    I was told that this doesn't work unless I have a doctype declaration in my web page. However, I noticed that I lose my page formatting when I do that. Here is that page with a doctype declaration, and here is that same page without it. That's the only difference between the two. (I am viewing this in IE6.)

    So here are my questions: Why am I losing my page formatting when I have a doctype declaration? Is there some funky way that I have to code this in ASP.NET to get my form to center?
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    SNAP to it!

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    I told you why its not working in the other thread, this thread they are probably going to need to see why the asp adds the underscores, they may need the server side stuff.

  • #3
    $object->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Jun 2003
    Posts
    3,100
    Thanks
    2
    Thanked 23 Times in 23 Posts
    The underscores that you're seeing are the rendered code, not what I put in there. You saw my code in the other thread. Like I said, it's an ASP.NET thing. I don't know why it does that. I've never had to ponder why until now. I just want to see if someone has some ASP.NET code that will fix this problem. It may be that, not CSS, that's the problem.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    SNAP to it!

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Then post the asp server side code not the link to the parse html page. The asp server side stuff is what we will need to see.

  • #5
    $object->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Jun 2003
    Posts
    3,100
    Thanks
    2
    Thanked 23 Times in 23 Posts
    That's what I posted in the other thread. I was trying not to make this thread a repeat of the other one, but oh well.

    Here's a simplified version of the top of my web page:

    Code:
    <html> 
    <head>
    <title>Contact Me</title>
    
    <link rel="stylesheet" href="test-styles.css" type="text/css">
    </head>
    
    <body>
    
    <div id="contents">
    
    	<div id="line1">
    		<div id="line1right"></div>
    		<div id="line1left"></div>
    	</div>
    	<div id="line2"></div>
    	<div id="line3"></div>
    
    	<div id="container">
    
    <p class="title">Contact Me</p>
    
    <form class="center_it" runat="server">
    Here is the relevant CSS I'm using, with bolding on the style definition that is supposed to center my form:

    Code:
    #line1{
    	width: 100%;
    	height: 65px;
    	top: 0px;
    	left: 0px;
    	background-color: #6d977f;
    }
    
    #line1left {
    	background: url(http://www.techtipscentral.net/images/TechTipsCentralLogo.jpg) no-repeat top left;
    	height: 65px;
    }
    
    #line1right {
    	background: url(http://www.techtipscentral.net/images/topright.jpg) no-repeat top right;
    	width: 132px;
    	height: 61px;
    	float: right;
    }
    
    #line2 {
    	background-color: #aec4b8;
    	height: 27px;
    }
    
    #line3 {
    	background: #808080;
    	height: 1px;
    }
    
    #contents {
    	background: url(http://www.techtipscentral.net/images/leftpic.jpg) no-repeat 0px 114px;
    }
    
    #container {
    	margin: 0 20px 20px 185px;
    }
    
    body {
    	background: url(http://www.techtipscentral.net/images/leftborder.jpg) repeat-y;
    	font-family: arial;
    	font-size: small;
    	margin: 0; 
    	padding: 0;
    	scrollbar-face-color: #336600;
    	scrollbar-track-color:#cccccc;
    	scrollbar-arrow-color: #ffffff;
    }
    
    html, body, #contents {
    	min-height: 100%;
    	width: 100%;
    	height: 100%;
    }
    
    html>body, html>body #contents {
    	height: auto;
    }
    
    .center_it {
    	margin: 0 auto;
    }
    So to further repeat what's been said in this thread, here's the problem:

    I was told that this doesn't work unless I have a doctype declaration in my web page. However, I noticed that I lose my page formatting when I do that. Here is that page with a doctype declaration, and here is that same page without it. That's the only difference between the two. (I am viewing this in IE6.)

    So here are my questions: Why am I losing my page formatting when I have a doctype declaration? Is there some funky way that I have to code this in ASP.NET to get my form to center?
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    SNAP to it!

  • #6
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    The asp is generating the html isn't it? You should post the ASP the server side stuff the stuff the user doesn't see. From the code you showed us there is no asp in the code that should generate the underscores. I guess the problem here is you aren't understanding me. How is the html generated? Do you write it or does an asp script generate it? If it is asp then post the script that generates the html.

  • #7
    $object->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Jun 2003
    Posts
    3,100
    Thanks
    2
    Thanked 23 Times in 23 Posts
    There is an American movie, Cool Hand Luke, with a classic line that epitomizes our conversation: "What we've got here is failure to communicate."

    The following bolded code is what makes this ASP.NET:

    Code:
    <form class="center_it" runat="server">
    That's the part of the code that makes the rendered code look like this:

    Code:
    <form name="_ctl0" method="post" action="contact_without_doctype.aspx" language="javascript" onsubmit="if (!ValidatorOnSubmit()) return false;" id="_ctl0">
    That's what ASP.NET does to it. I don't know what it's purpose is in rendering the code like that. That's what ASP.NET programmers refer to as "under the hood" stuff. Change that, and you change the whole .NET framework.

    All of this is to say, changing that is not an option. Problem is, I don't know what I do need to change to center my form.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    SNAP to it!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •