Why is not the second control visible in design mode

T

Tony Johansson

Hello!

Here is a simple aspx markup page and we have here two controls
The first one is a select html server control (class HtmlSelect) and the
second is a submit html server control(class HtmlInputSubmit).
The strange thing here is that the second control which is the sumbit
control is not shown in design mode but
is shown is runtime.
Can someboy explain that ?

If I for example change place on these then both is shown in design mode.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<select id="currency" runat="server" />
<input type="submit" value="OK" id="convert" runat="server" />
</div>
</form>
</body>
</html>

//Tony
 
N

Nitin Jain.

select should have closing tag.
Replace
<select id="currency" runat="server" />
to
<select id="currency" runat="server" ></select>

and check again.
 
G

Guest

thanks!

"Nitin Jain." skrev i meddelandet

select should have closing tag.
Replace
<select id="currency" runat="server" />
to
<select id="currency" runat="server" ></select>

and check again.
 
G

Guest

I just wonder normally you can close a tag by using a slash as in this
example
<select id="currency" runat="server" / >

But here you must close the tag by using the end tag
<select id="currency" runat="server" ></select>

Why
I mean when I use for example a label I close the tag by using the slash

//Tony

"Nitin Jain." skrev i meddelandet

select should have closing tag.
Replace
<select id="currency" runat="server" />
to
<select id="currency" runat="server" ></select>

and check again.
 
A

Arne Vajhøj

I just wonder normally you can close a tag by using a slash as in this
example
<select id="currency" runat="server" / >

But here you must close the tag by using the end tag
<select id="currency" runat="server" ></select>

Why
I mean when I use for example a label I close the tag by using the slash

First: the space between / and > is not good.

Second: select must contain at least one option to be valid.

Third: /> is a XHTML feature not a HTML feature, so it should
only work with XHTML.

Arne
 
G

Guest

"Arne Vajhøj" skrev i meddelandet

I just wonder normally you can close a tag by using a slash as in this
example
<select id="currency" runat="server" / >

But here you must close the tag by using the end tag
<select id="currency" runat="server" ></select>

Why
I mean when I use for example a label I close the tag by using the slash

First: the space between / and > is not good.

Second: select must contain at least one option to be valid.

Third: /> is a XHTML feature not a HTML feature, so it should
only work with XHTML.

Arne

Hello!

I can skip this option and it will work even without one.
So in that sense this option is not mandatory

//Tony
 
A

Arne Vajhøj

"Arne Vajhøj" skrev i meddelandet
I can skip this option and it will work even without one.
So in that sense this option is not mandatory

The DTD still says:

<!ELEMENT SELECT - - (OPTGROUP|OPTION)+ -- option selector -->

That + should mean 1 or more not 0 or more.

Arne
 
G

Guest

"Arne Vajhøj" skrev i meddelandet

"Arne Vajhøj" skrev i meddelandet
I can skip this option and it will work even without one.
So in that sense this option is not mandatory

The DTD still says:

<!ELEMENT SELECT - - (OPTGROUP|OPTION)+ -- option selector -->

That + should mean 1 or more not 0 or more.

Arne

Hello

What I try to say is that why do I not get any kind of error if I skip this
Option.
The only kind of thing that happen is that in design mode will a button that
exist after the select will not be shown but
the button will be shown is runtime mode.
Because the select require a option why do we not get a compile error

//Tony
 
R

Registered User

"Arne Vajhøj" skrev i meddelandet




The DTD still says:

<!ELEMENT SELECT - - (OPTGROUP|OPTION)+ -- option selector -->

That + should mean 1 or more not 0 or more.

Arne

Hello

What I try to say is that why do I not get any kind of error if I skip this
Option.
The only kind of thing that happen is that in design mode will a button that
exist after the select will not be shown but
the button will be shown is runtime mode.
Because the select require a option why do we not get a compile error
The error is not found at compile-time because neither the DTD or the
XML document are compiled. Errors in these documents will be
discovered at run-time by the appropriate instantiated parser.

regards
A.G.
 
A

Arne Vajhøj

"Arne Vajhøj" skrev i meddelandet
What I try to say is that why do I not get any kind of error if I skip
this Option.
The only kind of thing that happen is that in design mode will a button
that exist after the select will not be shown but
the button will be shown is runtime mode.
Because the select require a option why do we not get a compile error

You hsould not write invalid HTML/XHTML just because something does
not check if the HTML/XHTML is valid.

Arne
 

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