Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Why is not the second control visible in design mode (http://www.velocityreviews.com/forums/t753052-why-is-not-the-second-control-visible-in-design-mode.html)

Tony Johansson 08-20-2011 03:17 PM

Why is not the second control visible in design mode
 
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



Nitin Jain. 08-22-2011 05:12 AM

Re: Why is not the second control visible in design mode
 
select should have closing tag.
Replace
<select id="currency" runat="server" />
to
<select id="currency" runat="server" ></select>

and check again.


08-22-2011 05:51 AM

Re: Why is not the second control visible in design mode
 
thanks!

"Nitin Jain." skrev i meddelandet
news:51d39642-d012-4e3f-be60-a473281c602d@glegroupsg2000goo.googlegroups.com...

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

and check again.


08-22-2011 06:02 AM

Re: Why is not the second control visible in design mode
 
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
news:51d39642-d012-4e3f-be60-a473281c602d@glegroupsg2000goo.googlegroups.com...

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

and check again.


Arne Vajh°j 08-23-2011 01:42 AM

Re: Why is not the second control visible in design mode
 
On 8/22/2011 2:02 AM, tony.johansson@systeam.se wrote:
> 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


08-24-2011 12:12 PM

Re: Why is not the second control visible in design mode
 
"Arne Vajh°j" skrev i meddelandet
news:4e530574$0$315$14726298@news.sunsite.dk...

On 8/22/2011 2:02 AM, tony.johansson@systeam.se wrote:
> 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


Arne Vajh°j 08-25-2011 01:18 AM

Re: Why is not the second control visible in design mode
 
On 8/24/2011 8:12 AM, tony.johansson@systeam.se wrote:
> "Arne Vajh°j" skrev i meddelandet
> news:4e530574$0$315$14726298@news.sunsite.dk...
>> Second: select must contain at least one option to be valid.


> 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

08-25-2011 02:17 PM

Re: Why is not the second control visible in design mode
 
"Arne Vajh°j" skrev i meddelandet
news:4e55a2dc$0$304$14726298@news.sunsite.dk...

On 8/24/2011 8:12 AM, tony.johansson@systeam.se wrote:
> "Arne Vajh°j" skrev i meddelandet
> news:4e530574$0$315$14726298@news.sunsite.dk...
>> Second: select must contain at least one option to be valid.


> 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


Registered User 08-25-2011 10:48 PM

Re: Why is not the second control visible in design mode
 
On Thu, 25 Aug 2011 16:17:36 +0200, <tony.johansson@systeam.se> wrote:

>"Arne Vajh°j" skrev i meddelandet
>news:4e55a2dc$0$304$14726298@news.sunsite.dk...
>
>On 8/24/2011 8:12 AM, tony.johansson@systeam.se wrote:
>> "Arne Vajh°j" skrev i meddelandet
>> news:4e530574$0$315$14726298@news.sunsite.dk...
>>> Second: select must contain at least one option to be valid.

>
>> 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
>

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.

Arne Vajh°j 08-26-2011 12:32 AM

Re: Why is not the second control visible in design mode
 
On 8/25/2011 10:17 AM, tony.johansson@systeam.se wrote:
> "Arne Vajh°j" skrev i meddelandet
> news:4e55a2dc$0$304$14726298@news.sunsite.dk...
> > On 8/24/2011 8:12 AM, tony.johansson@systeam.se wrote:
>>> "Arne Vajh°j" skrev i meddelandet
>>> news:4e530574$0$315$14726298@news.sunsite.dk...
>>>> Second: select must contain at least one option to be valid.

>>
>>> 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.


> 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



All times are GMT. The time now is 10:43 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.