472,353 Members | 1,654 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

<form runat="server"> automatically adds <div> tag to code contained within. Is there a way to stop that?

<form runat="server"automatically adds <divtag to code contained
within. Is there a way to stop that?

Mixing block-level elements with inline-level elements messes up the
HTML becasuse that is invalid for a strict implementation. <spanis
in-line-level and <divis block-level. I don't want to mix up <span>
and <div>

I'm using an <asp:Buttonhere because when it switches to the URL I
need to check that the user is in the correct role - their role
determines which page they go to. Perhaps there's a better way to do
that?, which allows me to avoid using a form and a postback here?

Here is my server-side code:

<tr>
<td colspan="3">
<a href="../Search/Search.aspx"><span class="MenuButtonLeft"
id="cmdSearch" onmouseover="MenuButtonIn(this);"
onmouseout="MenuButtonOut(this);">Search and Data Download</span></a>
<span class="MenuSpacerLeft"></span>
<form id="Form1" runat="server"><asp:Button
ID="cmdPensionwatch" runat="server" Text="PensionWatch"
CssClass="MenuButtonLeft2" OnCommand="cmdPensionwatch_Command" /></
form>
<span class="MenuSpacerLeft"></span>
<a href="../DealFlow/DealFlow.aspx"><span
class="MenuButtonLeft" id="cmdDealFlow"
onmouseover="MenuButtonIn(this);" onmouseout="MenuButtonOut(this);"
>Deal Flow</span></a>
<span class="MenuSpacerLeft"></span>
<span></span>
<a href="javascript:downloadSummaryPDF('M');"><span
class="MenuButtonRight" id="cmd4Week"
onmouseover="MenuButtonIn(this);" onmouseout="MenuButtonOut(this);" >4
week Summary</span></a>
<span class="MenuSpacerRight"></span>
<a href="javascript:downloadSummaryPDF('F');"><span
class="MenuButtonRight" id="cmd2Week"
onmouseover="MenuButtonIn(this);" onmouseout="MenuButtonOut(this);" >2
week Summary</span></a>
<span class="MenuSpacerRight"></span>
<a href="javascript:downloadSummaryPDF('W');"><span
class="MenuButtonRight" id="cmd1Week"
onmouseover="MenuButtonIn(this);" onmouseout="MenuButtonOut(this);" >1
week Summary</span></a>
<span class="MenuSpacerRight"></span>
</td>
</tr>
This is my HTML. Notice how the inline <spanand block-level <div>
are mixed up - ouch!
<tr>
<td colspan="3">
<a href="../Search/Search.aspx"><span class="MenuButtonLeft"
id="cmdSearch" onmouseover="MenuButtonIn(this);"
onmouseout="MenuButtonOut(this);">Search and Data Download</span></a>
<span class="MenuSpacerLeft"></span>
<form name="Form1" method="post" action="News.aspx"
id="Form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
value="...blah...blah..." />
</div>
<input type="submit" name="cmdPensionwatch" value="PensionWatch"
id="cmdPensionwatch" class="MenuButtonLeft2"
onmouseover="MenuButtonIn(this);" onmouseout="MenuButtonOut(this);" />
<div>

<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION"
value="...blah...blah..." />
</div></form>
<span class="MenuSpacerLeft"></span>
<a href="../DealFlow/DealFlow.aspx"><span
class="MenuButtonLeft" id="cmdDealFlow"
onmouseover="MenuButtonIn(this);" onmouseout="MenuButtonOut(this);"
>Deal Flow</span></a>
<span class="MenuSpacerLeft"></span>
<span></span>
<a href="javascript:downloadSummaryPDF('M');"><span
class="MenuButtonRight" id="cmd4Week"
onmouseover="MenuButtonIn(this);" onmouseout="MenuButtonOut(this);" >4
week Summary</span></a>
<span class="MenuSpacerRight"></span>
<a href="javascript:downloadSummaryPDF('F');"><span
class="MenuButtonRight" id="cmd2Week"
onmouseover="MenuButtonIn(this);" onmouseout="MenuButtonOut(this);" >2
week Summary</span></a>
<span class="MenuSpacerRight"></span>
<a href="javascript:downloadSummaryPDF('W');"><span
class="MenuButtonRight" id="cmd1Week"
onmouseover="MenuButtonIn(this);" onmouseout="MenuButtonOut(this);" >1
week Summary</span></a>
<span class="MenuSpacerRight"></span>
</td>
</tr>

Apr 2 '07 #1
1 2246
mark4asp wrote:
<form runat="server"automatically adds <divtag to code contained
within. Is there a way to stop that?

Mixing block-level elements with inline-level elements messes up the
HTML becasuse that is invalid for a strict implementation. <spanis
in-line-level and <divis block-level. I don't want to mix up <span>
and <div>

I'm using an <asp:Buttonhere because when it switches to the URL I
need to check that the user is in the correct role - their role
determines which page they go to. Perhaps there's a better way to do
that?, which allows me to avoid using a form and a postback here?
You can't have inline elements directly inside the form tag, so you need
that div tag.

--
Göran Andersson
_____
http://www.guffa.com
Apr 3 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Michael | last post by:
There seem to be two ways to include files on the server: 1. <!-- #include file="header.inc" --> 2. <script language="VBScript" runat="server"...
13
by: Dan R Brown | last post by:
I have a large form that is generated dynamically in a jsp using xml / xslt. So, to break up this form into several "tabbed" sections, I break up...
3
by: Islam Elkhayat | last post by:
Hello everybody Ihave few .CSS files, I let user select the color schema of the whole site using a radiobutton and save it in a cookie.. I want...
4
by: Tim Mulholland | last post by:
I have one page where i have some <div> tags set to be runat="server" (and i've given them an id) and i can access them from the code-behind file...
3
by: Jim in Arizona | last post by:
Most of the asp.net learning I've done has been from books that were written during the 1.0 framework. I didn't have a copy of visual studio when I...
9
ihaveaquery
by: ihaveaquery | last post by:
Hi, Delete is working fine for me, but Update- Nothing is happening. Please find the code snippet below and help me out... <asp:GridView...
9
Basharat
by: Basharat | last post by:
Hi all I have problem on firing "onmouseleave" event of <div> html element. Here is the code im using: <div ID="BSHelpPanel" class="PageMenuMain"...
1
by: sandeep kumar shah | last post by:
Hi, We have used a file uploading HTML tag in an HTML page. We need to customize the text displayed on the Button (which is by...
4
by: justice750 | last post by:
Hi All, I am using a FormView control. The allows me to update records in the database. However, when a database field is null I can not update...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.