Why is not the second control visible in design mode

Discussion in 'ASP .Net' started by Tony Johansson, Aug 20, 2011.

  1. 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
    Tony Johansson, Aug 20, 2011
    #1
    1. Advertising

  2. Tony Johansson

    Nitin Jain. Guest

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

    and check again.
    Nitin Jain., Aug 22, 2011
    #2
    1. Advertising

  3. Tony Johansson

    Guest Guest

    thanks!

    "Nitin Jain." skrev i meddelandet
    news:...

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

    and check again.
    Guest, Aug 22, 2011
    #3
  4. Tony Johansson

    Guest 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
    news:...

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

    and check again.
    Guest, Aug 22, 2011
    #4
  5. Tony Johansson

    Arne Vajhøj Guest

    On 8/22/2011 2:02 AM, 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
    Arne Vajhøj, Aug 23, 2011
    #5
  6. Tony Johansson

    Guest Guest

    "Arne Vajhøj" skrev i meddelandet
    news:4e530574$0$315$...

    On 8/22/2011 2:02 AM, 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
    Guest, Aug 24, 2011
    #6
  7. Tony Johansson

    Arne Vajhøj Guest

    On 8/24/2011 8:12 AM, wrote:
    > "Arne Vajhøj" skrev i meddelandet
    > news:4e530574$0$315$...
    >> 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
    Arne Vajhøj, Aug 25, 2011
    #7
  8. Tony Johansson

    Guest Guest

    "Arne Vajhøj" skrev i meddelandet
    news:4e55a2dc$0$304$...

    On 8/24/2011 8:12 AM, wrote:
    > "Arne Vajhøj" skrev i meddelandet
    > news:4e530574$0$315$...
    >> 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
    Guest, Aug 25, 2011
    #8
  9. On Thu, 25 Aug 2011 16:17:36 +0200, <> wrote:

    >"Arne Vajhøj" skrev i meddelandet
    >news:4e55a2dc$0$304$...
    >
    >On 8/24/2011 8:12 AM, wrote:
    >> "Arne Vajhøj" skrev i meddelandet
    >> news:4e530574$0$315$...
    >>> 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.
    Registered User, Aug 25, 2011
    #9
  10. Tony Johansson

    Arne Vajhøj Guest

    On 8/25/2011 10:17 AM, wrote:
    > "Arne Vajhøj" skrev i meddelandet
    > news:4e55a2dc$0$304$...
    > > On 8/24/2011 8:12 AM, wrote:
    >>> "Arne Vajhøj" skrev i meddelandet
    >>> news:4e530574$0$315$...
    >>>> 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
    Arne Vajhøj, Aug 26, 2011
    #10
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tshad

    button visible/not visible

    tshad, Oct 26, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    4,444
    Brian Hoops
    Oct 28, 2004
  2. tshad

    Sections visible and not visible

    tshad, Jan 31, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    2,060
    tshad
    Jan 31, 2005
  3. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,839
    Smokey Grindel
    Dec 2, 2006
  4. Andrea Williams

    User control not visible when setting .Visible = true;

    Andrea Williams, Jan 26, 2004, in forum: ASP .Net Web Controls
    Replies:
    4
    Views:
    513
    Andrea Williams
    Jan 28, 2004
  5. Jurjen de Groot
    Replies:
    0
    Views:
    300
    Jurjen de Groot
    May 19, 2008
Loading...

Share This Page