DIV Question ?

S

Stan Sainte-Rose

Hi,

How to remove the div tag that VS adds.
This div seems to wrap the viewstate variable :
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
value="/wEPDwULLTEwMDUyNjYzMjhkZPaLtX/KEmygoeFARPC9zkhTTeTP" />
</div>

I usually use div for designing my webpage like this :
....
....
<div id="container">
<div id="header">Welcome</div>
<div id="leftnav"></div>
<div id="content">bla bla bla</div>
<div id="footer">bla</div>
</div>
....
.....

Using VS.net, I get this code :

<form method="post" action="test.aspx" id="aspnetForm">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
value="/wEPDwULLTEwMDUyNjYzMjhkZPaLtX/KEmygoeFARPC9zkhTTeTP" />
</div>
<div id="container">
<div id="header">Welcome</div>
<div id="leftnav"></div>
<div id="content">bla bla bla</div>
<div id="footer">bla</div>
</div>
</form>

So, how to remove the first Div Tags ?
Just to get :
<form method="post" action="test.aspx" id="aspnetForm">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
value="/wEPDwULLTEwMDUyNjYzMjhkZPaLtX/KEmygoeFARPC9zkhTTeTP" />
<div id="container">
<div id="header">Welcome</div>
<div id="leftnav"></div>
<div id="content">bla bla bla</div>
<div id="footer">bla</div>
</div>
</form>

Any help ?

Stan
http://www.netsunset.com
 
Y

Yunus Emre ALPÖZEN [MCAD.NET]

why do u need something like this ? Just for ui design ? You can use css
class for different ui designs... u should not override div element, just
use a cssclass for your ui design div elements
 
S

Stan Sainte-Rose

Yunus,

I don't have problem for the css parts and classes.
I want to know why VS.net adds this new DIV section, this one :
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
value="/wEPDwULLTEwMDUyNjYzMjhkZPaLtX/KEmygoeFARPC9zkhTTeTP" />
</div>

It doesn't make sense and that makes the code a bit dirty.
Why it doesn't just add
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
value="/wEPDwULLTEwMDUyNjYzMjhkZPaLtX/KEmygoeFARPC9zkhTTeTP" />
Without the <div> tags ?

Stan
http://www.netsunset.com



"Yunus Emre ALPÖZEN [MCAD.NET]" a écrit dans le message de (e-mail address removed)...
 
Y

Yunus Emre ALPÖZEN [MCAD.NET]

what is your vs.net version ??
I created a new web project and just execute it. Resulting;

<form name="Form1" method="post" action="WebForm1.aspx" id="Form1">
<input type="hidden" name="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE"
value="dDwtOTE5ODA4ODkyO3Q8O2w8aTwxPjs+O2w8dDw7bDxpPDE+O2k8Mj47PjtsPHQ8QDA8Ozs7Ozs7Ozs7Oz47Oz47dDxwPHA8bDxHcm91cE5hbWU7PjtsPFJhZGlvQnV0dG9uMTs+Pjs+Ozs+Oz4+Oz4+O2w8UmFkaW9CdXR0b24xO1JhZGlvQnV0dG9uMTtDaGVja0JveDE7Pj4a9lA/vrUejHXnCR/D7hwePAvcQA=="
/>

There is no div in my code.... I use VS.NET 2003 EA
--

Thanks,
Yunus Emre ALPÖZEN
BSc, MCAD.NET

Stan Sainte-Rose said:
Yunus,

I don't have problem for the css parts and classes.
I want to know why VS.net adds this new DIV section, this one :
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
value="/wEPDwULLTEwMDUyNjYzMjhkZPaLtX/KEmygoeFARPC9zkhTTeTP" />
</div>

It doesn't make sense and that makes the code a bit dirty.
Why it doesn't just add
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
value="/wEPDwULLTEwMDUyNjYzMjhkZPaLtX/KEmygoeFARPC9zkhTTeTP" />
Without the <div> tags ?

Stan
http://www.netsunset.com



"Yunus Emre ALPÖZEN [MCAD.NET]" a écrit dans le message de (e-mail address removed)...
why do u need something like this ? Just for ui design ? You can use css
class for different ui designs... u should not override div element, just
use a cssclass for your ui design div elements

--

Thanks,
Yunus Emre ALPÖZEN
BSc, MCAD.NET
 
S

Stan Sainte-Rose

Oopss.. I forgot to say, that I use the Visual Web Developer Express 2005
Edition Beta
and also use the masterpager function..

Stan


Yunus Emre ALPÖZEN said:
what is your vs.net version ??
I created a new web project and just execute it. Resulting;

<form name="Form1" method="post" action="WebForm1.aspx" id="Form1">
<input type="hidden" name="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE"
value="dDwtOTE5ODA4ODkyO3Q8O2w8aTwxPjs+O2w8dDw7bDxpPDE+O2k8Mj47PjtsPHQ8QDA8Ozs7Ozs7Ozs7Oz47Oz47dDxwPHA8bDxHcm91cE5hbWU7PjtsPFJhZGlvQnV0dG9uMTs+Pjs+Ozs+Oz4+Oz4+O2w8UmFkaW9CdXR0b24xO1JhZGlvQnV0dG9uMTtDaGVja0JveDE7Pj4a9lA/vrUejHXnCR/D7hwePAvcQA=="
/>

There is no div in my code.... I use VS.NET 2003 EA
--

Thanks,
Yunus Emre ALPÖZEN
BSc, MCAD.NET

Stan Sainte-Rose said:
Yunus,

I don't have problem for the css parts and classes.
I want to know why VS.net adds this new DIV section, this one :
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
value="/wEPDwULLTEwMDUyNjYzMjhkZPaLtX/KEmygoeFARPC9zkhTTeTP" />
</div>

It doesn't make sense and that makes the code a bit dirty.
Why it doesn't just add
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
value="/wEPDwULLTEwMDUyNjYzMjhkZPaLtX/KEmygoeFARPC9zkhTTeTP" />
Without the <div> tags ?

Stan
http://www.netsunset.com



"Yunus Emre ALPÖZEN [MCAD.NET]" a écrit dans le message de (e-mail address removed)...
why do u need something like this ? Just for ui design ? You can use css
class for different ui designs... u should not override div element,
just use a cssclass for your ui design div elements

--

Thanks,
Yunus Emre ALPÖZEN
BSc, MCAD.NET

Hi,

How to remove the div tag that VS adds.
This div seems to wrap the viewstate variable :
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
value="/wEPDwULLTEwMDUyNjYzMjhkZPaLtX/KEmygoeFARPC9zkhTTeTP" />
</div>

I usually use div for designing my webpage like this :
...
...
<div id="container">
<div id="header">Welcome</div>
<div id="leftnav"></div>
<div id="content">bla bla bla</div>
<div id="footer">bla</div>
</div>
...
....

Using VS.net, I get this code :

<form method="post" action="test.aspx" id="aspnetForm">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
value="/wEPDwULLTEwMDUyNjYzMjhkZPaLtX/KEmygoeFARPC9zkhTTeTP" />
</div>
<div id="container">
<div id="header">Welcome</div>
<div id="leftnav"></div>
<div id="content">bla bla bla</div>
<div id="footer">bla</div>
</div>
</form>

So, how to remove the first Div Tags ?
Just to get :
<form method="post" action="test.aspx" id="aspnetForm">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
value="/wEPDwULLTEwMDUyNjYzMjhkZPaLtX/KEmygoeFARPC9zkhTTeTP" />
<div id="container">
<div id="header">Welcome</div>
<div id="leftnav"></div>
<div id="content">bla bla bla</div>
<div id="footer">bla</div>
</div>
</form>

Any help ?

Stan
http://www.netsunset.com
 
S

Showjumper

This is because ASP.NET 2.0 generates pages that are xhtml compliant and is
per the xhtml spec to wrap the input tag in a div
 
S

Stan Sainte-Rose

Yes, I can understand but it 's still a problem because
when I do that

<div id="container">
<form id="form1" runat="server" method="post">
<div id="header">Welcome</div>
<div id="leftnav"></div>
<div id="content">bla bla bla</div>
<div id="footer">bla</div>
</form>
</div>
..
It still adds a new DIV section between container and header

Stan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top