This is my aspx code
<body >
<form id="_form1" runat="server" >
<div style=" width:100%; text-align:center;">
<div style="width:80%; margin:0 auto;" >
<asp:ContentPlaceHolder ID="_head" runat="server"></asp:ContentPlaceHolder>
</div>
</div>
</form>
</body>
in my ContentPlaceHolder I have
<div>
This is test...
</div>
When I run this application my html in IE8 renders as
<html>
...
<div>
<table>
<tr>
<td>
<div>
this is test
<div>
</td>
</tr>
</table>
<div>
...
</html>
now where is this table coming from and how do i change it ??
Thanks
What setup are you using? If you are at the beginning of a project and really concerned about the structure of the generated HTML, you may be interested in asp.NET MVC which is more web/html standards oriented.
EDIT - This is the output I get when I do what you say your doing, as far as I can tell from your question.
<body >
<form name="aspnetForm" method="post" action="WebForm1.aspx" id="aspnetForm">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTEwMDUyNjYzMjhkZBdGjIzV2B+QZdda+0wRGTEHyQlg" />
</div>
<div style=" width:100%; text-align:center;">
<div style="width:80%; margin:0 auto;" >
<div>
This is test...
</div>
</div>
</div>
</form>
</body>
At least four possibilities exist
You're doing it wrong.
I'm doing it wrong but at least getting desired results.
We're both doing it wrong.
We are using different versions of asp.net, setting up our projects differently etc. more details may actually be helpful
Do you have a master page between your MasterPage you defined above and the content that you also defined above. The .NET framework doesn't auto insert tables, the only way that would get inserted in for a ContentPlaceHolder is if one is defined in a master page. Or another process was auto inserting the table structure in.
Also it is not apparent in the UI, but master pages can also have master pages, so make sure you don't have a master page in between that could be adding tables.
ASP.NET Renders as tables on certain internet browsers. On internet explorer, it renders as a table and on chrome it renders as a div tag.
I do not know exactly how to prevent this on default, but i used a .dll file called CSSFriendly which enabled me to render the menu as a list instead of a table as well. Perhaps you can try this out for the content placeholder.
Kind Regards
Related
i tried below code.
code1:
<table><tr>
<td><table>table1</table></td>
<td><table>table2</table></td>
</table>
It works fine, But after certain height introduces page break, which i want to avoid.So im trying below code,
Code2:
<div style="width:650px">
<table align="right" style="width:500px;">table1</table>
<table align="left" style="width:125px;">table2</table>
</div>
This is not working in outlook mail, Please can anybody suggest me How to make 2nd code work in outlook? or How to overcome pagebreak problem in first code?
Depending on your content and space, you can use floats or inline display:
<div style="width:650px">
<table style="display:inline-block;">table1</table>
<table style="float: left;">table2</table>
</div>
Demo
I am new to bootstrap and I watched some tutorials (ASP.NET).
I created a button with a CssClass:
But the button looks bugged? It must look like the first button, but my button is the second:
I have no clue what I am doing wrong!
This is my container:
<div class="container">
<div class="row">
<div class="span2">...</div>
<div class="span8">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
<div class="span2">
<asp:Button ID="btnSignup" runat="server" Text="Button" CssClass="btn btn-large btn-success" />
</div>
</div>
<h1>Bootstrap starter template</h1>
<p>Use this document as a way to quick start any new project.<br/> All you get is this message and a barebones HTML document.</p>
</div>
Did you modify Bootstrap CSS in any way or are you loading any additional CSS?
What browser are you seeing this in?
It would help if you posted your code on jsfiddle.net
Anyway, this issue happens when you remove background-image from the normal (mouse out) button state of the .btn-success class. Bootstrap uses transition to shift background-position by 15px in hover state and this is what you end up with.
Found the answer!
I downloaded the customized bootstrap files with full features via this link:
http://twitter.github.io/bootstrap/customize.html
Then I am getting that bug.
But when I download bootstrap from below, and replace the css file from the customized bootstrap with the new downloaded css:
http://twitter.github.io/bootstrap/
Then I don't have any bugs!
Just to complement your own answer, since you are using bootstrap + Visual Studio, you may have to know that there's a bug on Visual Studio that edits some CSS3 properties.
You should keep an backup from bootstrap.css, because this issue may happen again when editing an .aspx, .htm that uses this stylesheet.
I just know the bug, but I don't have any solutions for it
I have to navigate from .asp page to .aspx page.
We are using the iframe concept so that the pages fit in the browser window.
My problem is that when we navigate from the .asp to .aspx page the contents are pushed down a little and we are using the concept <body MS_POSITIONING="flowlayout"> in the top inside which we use form concept to fill in the contents.
Could anyone help me how to push the contents to top of the page?
I fixed the issue myself. I simply added POSITION:absolute; TOP:0px; in the table tag
like for example:
<body MS_POSITIONING="flowlayout">
<form id="example" method="post" runat="server">
<table cellSpacing="0" style="MARGIN-TOP:0px; POSITION:absolute; TOP:0px;"cellPadding="0" width="100%" align="center" border="0">
//content
</table>
</form>
</body>
and the website was looking fine.
I am creating an aspx page which appears fine in mozilla firefox but does not look so great in Internet explorer. In Mozilla its appearing something of this format:
<form>
some stuff
<div class="left">
<div class="right">
</form>
but looking at the source code of the page loaded in IE 8, it looks sometbhing like this:
<form>
some stuff
</form>
<div class="left">
<div class="right">
What approach should I take to start fixing it? So far I've tried playing around with the css and fixing paddings and margins but nothing works :/
Thanks so much
C
I think the OP's code is just pseudocode to illustrate his point. If the left and right divs are floated, you might need to add a clearing element after them, to make the form expand around it.
<form>
<div class="left">Stuff</div>
<div class="right">Stuff</div>
<br style="clear: both;" />
</form>
There are better methods than <br style="clear:both; />, but you can try it to see if it fixes your problem.
I am using asp.net and C#.
I have a image and three line. Which I want to place like this
Like the one you can see in this below URL .
http://www.campaignmonitor.com/gallery/
Image is on the left side and parallel to image we can write text.
I know that the same can be acheived by HTML table / ASP.NET table like this
<table>
<tr>
<td>
<img src="#"/>
</td>
<td>
first line <br />
second line <br/>
third line <br />
</td>
</tr>
</table>
but my problem is that I can't use table, so please let me know how can i acheive the above task without using tables.
Might be <span> or <div> tag can do the trick. but I am really dumb in html. and I can't ever search the exact answer to my problem on google..
Using CSS, you can float the image to the left, which will cause the text to appear to the image's right.
For example, take the following:
<html>
<head><title>Example</title></head>
<body>
<div style="float:left"> <!-- I've floated the div containing the image to the left -->
<img src="http://www.google.com/images/srpr/nav_logo13.png">
</div>
This is text that is to the right of the image.
</body>
</html>