473,583 Members | 3,112 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

<form runat="server"a utomatically 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:Buttonhe re 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"><s pan class="MenuButt onLeft"
id="cmdSearch" onmouseover="Me nuButtonIn(this );"
onmouseout="Men uButtonOut(this );">Search and Data Download</span></a>
<span class="MenuSpac erLeft"></span>
<form id="Form1" runat="server"> <asp:Button
ID="cmdPensionw atch" runat="server" Text="PensionWa tch"
CssClass="MenuB uttonLeft2" OnCommand="cmdP ensionwatch_Com mand" /></
form>
<span class="MenuSpac erLeft"></span>
<a href="../DealFlow/DealFlow.aspx"> <span
class="MenuButt onLeft" id="cmdDealFlow "
onmouseover="Me nuButtonIn(this );" onmouseout="Men uButtonOut(this );"
>Deal Flow</span></a>
<span class="MenuSpac erLeft"></span>
<span></span>
<a href="javascrip t:downloadSumma ryPDF('M');"><s pan
class="MenuButt onRight" id="cmd4Week"
onmouseover="Me nuButtonIn(this );" onmouseout="Men uButtonOut(this );" >4
week Summary</span></a>
<span class="MenuSpac erRight"></span>
<a href="javascrip t:downloadSumma ryPDF('F');"><s pan
class="MenuButt onRight" id="cmd2Week"
onmouseover="Me nuButtonIn(this );" onmouseout="Men uButtonOut(this );" >2
week Summary</span></a>
<span class="MenuSpac erRight"></span>
<a href="javascrip t:downloadSumma ryPDF('W');"><s pan
class="MenuButt onRight" id="cmd1Week"
onmouseover="Me nuButtonIn(this );" onmouseout="Men uButtonOut(this );" >1
week Summary</span></a>
<span class="MenuSpac erRight"></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"><s pan class="MenuButt onLeft"
id="cmdSearch" onmouseover="Me nuButtonIn(this );"
onmouseout="Men uButtonOut(this );">Search and Data Download</span></a>
<span class="MenuSpac erLeft"></span>
<form name="Form1" method="post" action="News.as px"
id="Form1">
<div>
<input type="hidden" name="__VIEWSTA TE" id="__VIEWSTATE "
value="...blah. ..blah..." />
</div>
<input type="submit" name="cmdPensio nwatch" value="PensionW atch"
id="cmdPensionw atch" class="MenuButt onLeft2"
onmouseover="Me nuButtonIn(this );" onmouseout="Men uButtonOut(this );" />
<div>

<input type="hidden" name="__EVENTVA LIDATION" id="__EVENTVALI DATION"
value="...blah. ..blah..." />
</div></form>
<span class="MenuSpac erLeft"></span>
<a href="../DealFlow/DealFlow.aspx"> <span
class="MenuButt onLeft" id="cmdDealFlow "
onmouseover="Me nuButtonIn(this );" onmouseout="Men uButtonOut(this );"
>Deal Flow</span></a>
<span class="MenuSpac erLeft"></span>
<span></span>
<a href="javascrip t:downloadSumma ryPDF('M');"><s pan
class="MenuButt onRight" id="cmd4Week"
onmouseover="Me nuButtonIn(this );" onmouseout="Men uButtonOut(this );" >4
week Summary</span></a>
<span class="MenuSpac erRight"></span>
<a href="javascrip t:downloadSumma ryPDF('F');"><s pan
class="MenuButt onRight" id="cmd2Week"
onmouseover="Me nuButtonIn(this );" onmouseout="Men uButtonOut(this );" >2
week Summary</span></a>
<span class="MenuSpac erRight"></span>
<a href="javascrip t:downloadSumma ryPDF('W');"><s pan
class="MenuButt onRight" id="cmd1Week"
onmouseover="Me nuButtonIn(this );" onmouseout="Men uButtonOut(this );" >1
week Summary</span></a>
<span class="MenuSpac erRight"></span>
</td>
</tr>

Apr 2 '07 #1
1 2416
mark4asp wrote:
<form runat="server"a utomatically 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:Buttonhe re 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
9377
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" src="header.inc"></script> What are the differences between the two, and when to use one instead of the other? Thanks.
13
40678
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 the form using <div> tags. Each <div style="display:none"> can be displayed by setting the style attribute to "display:", or hidden with "display:none". This gives the illusion that the person...
3
7294
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 to retrieve the value of the cookie <link href=" HERE " rel="stylesheet"> i try to put it using InnerHtml or InnerText but it fail using div, span so on... how can i handle this.. thanx
4
4258
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 just fine. I have another page where i've done essentially the same thing (even copying the code from the other file) and i cannot access them from the code-behind file. Any clues what would...
3
3488
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 started reading them then I got a hold of VS 2005 Beta 1, then Beta 2. I was using the <div runat="server"> statement on my projects. Once I placed a <div id="testdiv" runat="server"> within my...
9
25736
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 ID="empGrid" runat="server" AllowSorting="True" AutoGenerateColumns="False" DataSourceID="empTestDataSource" > <Columns> <asp:ButtonField CommandName="Select" ...
9
5557
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" onclick="javascript:this.style.display='none';" runat="server" > its working fine in IE while some other events too are not firing in firefox like ondeactivate onfocusout etc.
1
3295
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 default “Browse…” for internet explorer). Below is the code we have used: CODE: <input type="file" style=" width:100%" id="importFile" name="importFile"/> As per our analysis we got...
4
2889
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 the field on the form. It works fine when the field is not a null value. I am not using any code behind (C#) to bind the data or manipulate the data. I have read that when there is a null value in...
0
8168
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7926
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8187
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6573
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5691
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3812
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3837
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2322
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1149
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.