Naming Container difference between VS2003 and VS2005

Discussion in 'ASP .Net Building Controls' started by Monty, Dec 4, 2007.

  1. Monty

    Monty Guest

    I have an ASP.Net project I developed in VS2003 (ASP.Net 1.1) that works
    fine, but when I convert it to VS2005 (ASP.Net 2.0) it's behavior seems to
    change. I have the following datagrid in my project:

    <asp:datagrid id="grid" runat="server" AutoGenerateColumns="False"
    AllowSorting="False" DataKeyField="myID">
    <Columns>
    <asp:TemplateColumn HeaderText="Action">
    <ItemTemplate>
    '''''''NOTE FOLLOWING LINE:
    <input Runat="server" ID="SelectedRequest" type="hidden"
    NAME="SelectedRequest" />
    '''''''NOTE PREVIOUS LINE ^
    <asp:Literal Runat="server"
    ID="litRadioButtons"></asp:Literal>
    </ItemTemplate>
    </asp:TemplateColumn>
    <asp:TemplateColumn HeaderText="Action Message">
    <ItemTemplate>
    Message:<br>
    <asp:TextBox ID="txtMessage" Runat="server" />
    </ItemTemplate>
    </asp:TemplateColumn>
    </Columns>
    </asp:datagrid>

    When I run this page in VS2003, the line noted above is rendered as:

    <input name="grid:_ctl2:SelectedRequest" id="grid__ctl2_SelectedRequest"
    type="hidden" />

    But when I run my converted project in VS2005, it is rendered as:

    <input name="SelectedRequest" type="hidden" id="SelectedRequest" />

    What am I missing here? Why isn't the ID of my input control being modified
    by it's naming container?

    TIA.
     
    Monty, Dec 4, 2007
    #1
    1. Advertising

  2. Monty

    Monty Guest

    Whoops, wrong group. I've moved it to framework.aspnet.


    "Monty" <> wrote in message
    news:%...
    >I have an ASP.Net project I developed in VS2003 (ASP.Net 1.1) that works
    >fine, but when I convert it to VS2005 (ASP.Net 2.0) it's behavior seems to
    >change. I have the following datagrid in my project:
    >
    > <asp:datagrid id="grid" runat="server" AutoGenerateColumns="False"
    > AllowSorting="False" DataKeyField="myID">
    > <Columns>
    > <asp:TemplateColumn HeaderText="Action">
    > <ItemTemplate>
    > '''''''NOTE FOLLOWING LINE:
    > <input Runat="server" ID="SelectedRequest" type="hidden"
    > NAME="SelectedRequest" />
    > '''''''NOTE PREVIOUS LINE ^
    > <asp:Literal Runat="server"
    > ID="litRadioButtons"></asp:Literal>
    > </ItemTemplate>
    > </asp:TemplateColumn>
    > <asp:TemplateColumn HeaderText="Action Message">
    > <ItemTemplate>
    > Message:<br>
    > <asp:TextBox ID="txtMessage" Runat="server" />
    > </ItemTemplate>
    > </asp:TemplateColumn>
    > </Columns>
    > </asp:datagrid>
    >
    > When I run this page in VS2003, the line noted above is rendered as:
    >
    > <input name="grid:_ctl2:SelectedRequest" id="grid__ctl2_SelectedRequest"
    > type="hidden" />
    >
    > But when I run my converted project in VS2005, it is rendered as:
    >
    > <input name="SelectedRequest" type="hidden" id="SelectedRequest" />
    >
    > What am I missing here? Why isn't the ID of my input control being
    > modified by it's naming container?
    >
    > TIA.
    >
     
    Monty, Dec 4, 2007
    #2
    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. vaidas gudas
    Replies:
    1
    Views:
    365
    Franco FigĂșn
    Jul 13, 2004
  2. vaidas gudas
    Replies:
    4
    Views:
    668
    Scott Allen
    Sep 29, 2004
  3. jakk
    Replies:
    4
    Views:
    12,214
  4. Monty
    Replies:
    7
    Views:
    432
    Walter Wang [MSFT]
    Dec 10, 2007
  5. Nick
    Replies:
    0
    Views:
    149
Loading...

Share This Page