how to use MS_POSITIONING="flowlayout" in aspx page? - asp.net

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.

Related

How to set background image in asp.net by using c# in master page

<body id="Body1" runat="server" style="background: url('imgBackThemeHomePage.jpeg'); background-repeat: repeat;">
<form id="form1" runat="server">
</form>
</body>
I am unable to set background image with the above code. Please tell me how to set background image in asp.net master page.
move image to images folder and then just modify your code as
Its working

anchor with changing iframe content

I tried to comment on this question for clarification to what I might need but without enough rep I can't so here we go...
I want change the content of an iframe while targeting an anchor tag to scroll to a certain point lower on the page.
I tried to implement the js on the other page but while it scrolled ok, the iframe content did not change.
Try this example:
<html>
<body>
The frame:
<iframe id="theFrame" src="about:blank" width="90%" height="600"></iframe>
<br />
The link: change frame and scroll to bottom
<br />
<div style="height:600px;background:#8cc">padding...</div>
Bottom of page.
<div id="bottomOfPage"><div><!--this is the marker-->
</body>
</html>

removing Title area section SharePoint

I want to remove the title area section which is above view all site content not the breadcrumb and move my quick launch next to breadcrumb...having
<td class="ms-titlearealeft" id="TitleAreaImageCell" valign="top" nowrap style="width: 1px; border-style: none; height: 1px;" height="1px"><div style="height:100%" class="ms-titleareaframe"><asp:ContentPlaceHolder id="PlaceHolderPageImage" runat="server"/></div></td>
this blank space above quick launch shows for all the pages.But when I am removing this my breadcrumb is getting towards left section which I don't want..Any idea how to remove this..
create a panel in side the master page
Cut the <tr> section of the place holder witch handles the title paste it inside the panel.
<asp:Panel visible="false" runat="server">
<table><tr><td>hiding placeholders</td></tr></table>
<tr>
<td class="ms-titlearealeft" id="TitleAreaImageCell" valign="middle" nowrap>
<div style="height:100%" class="ms-titleareaframe">
<asp:ContentPlaceHolder id="PlaceHolderPageImage" runat="server" />
</div>
</td>
</asp:Panel>
make sure visiblity of your panel is hidden.
now you can get your quick launch next to bread crumb
Like this way you can hide othe place holders
Are you editing the master page? Why don't you just place a blank image there or something?

Why on earth ContentPlaceHolder renders as table?

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

Relative path in MasterPage in virtual directory

I have a table that looks like this in a usercontrol. Then the usercontrol is used on the masterpage.
<table>
<tr>
<td width="80%" style="background-image: url(/images/Header_right.gif); background-repeat: repeat-x;">
</td>
</tr>
</table>
If the aspx page is in the root directory of the site it works. But if the aspx page is a level deeper the path is no longer valid. (Default.aspx VS /Projects/Default.aspx)
Is there another way to get the image to repeat like the above table cell? Fixing the path would be great but my goal is to have the image take up the rest of the browser screen.
NOTE: This problem appeared after moving the site into a virtual directory.
Use a Style Sheet
The best way is to use a style sheet rather than an embedded style. Then you don't have to worry about the relative path from the control as the path will be relative to the style sheet.
ResolveClientUrl()
If for some reason you can't use a style sheet, you can resolve the url relative to the application root with a tilda (~). ASP.Net controls can resolve this automatically, but in this case you will need to call ResolveClientUrl() yourself.
<table>
<tr>
<td width="80%" style="background-image: url(<%= ResolveClientUrl(”~/images/Header_right.gif”) %>); background-repeat: repeat-x;">
</td>
</tr>
</table>
But really, the best way is to use a style sheet.
Define a class in your CSS file that references the image relative to the CSS file. Apply that class to the particular element you want to style with that class. This will help keep the paths correct.
Note this assumes that your CSS file is in the same directory tree as the images, but in a sibling directory.
CSS
.header-bg
{
background-image: url(../images/Header_right.gif);
background-repeat: repeat-x;
}
Mark up
<link rel="stylesheet"
type="text/css"
href="~/Content/styles/site.css"
ID="siteCss"
runat="server" />
<table>
<tr>
<td width="80%" class="header-bg"></td>
</tr>
</table>
Use css class for styling. All classes put to separate css file and reference it in the master page file. Then path to images all always relative to location of css, and you don't have a problem with locations of aspx page!

Resources