error..of type 'TextBox' must be placed inside a form tag with runat=server

Discussion in 'ASP .Net Datagrid Control' started by Eliyahu Goldin, Jan 5, 2005.

  1. Try removing Runat=server from the textbox inside the template.

    Eliyahu

    "Jim" <> wrote in message
    news:...
    > Hi
    >
    > I placed a checkboxcontrol in a datagrid:
    >
    > <form id="Form1" method="post" runat="server">
    > <asp:DataGrid id="DataGrid1" style="Z-INDEX: 101; LEFT: 152px;

    POSITION:
    > absolute; TOP: 56px"
    > runat="server" Height="288px" Width="368px">
    > <Columns>
    > <asp:TemplateColumn>
    > <ItemTemplate>
    > <asp:TextBox ID="test" Text='<%#(DataBinder.Eval(Container,
    > DataItem.customerid"))%' Runat=server>
    > </asp:TextBox>
    > </ItemTemplate>
    > </asp:TemplateColumn>
    > </Columns>
    > </asp:DataGrid>
    > </form>
    >
    > the textbox is enclosed by the form tag so what could be wrong?
    >
    > ch Jim
    >
    >
     
    Eliyahu Goldin, Jan 5, 2005
    #1
    1. Advertising

  2. Eliyahu Goldin

    Rock Guest

    You don't need parens around the DataBinder:

    <asp:TemplateColumn HeaderText="Validated">
    <ItemTemplate>
    <asp:textbox id=test
    runat="server"
    Text='<%#DataBinder.Eval(Container.DataItem,
    "Validated") %>'>
    </asp:textbox>

    </ItemTemplate>
    </asp:TemplateColumn>

    "Jim" <> wrote in message
    news:e%...
    > i tried that then your textbox is gone!
    >
    > Jim
    > "Eliyahu Goldin" <> wrote in message
    > news:...
    > > Try removing Runat=server from the textbox inside the template.
    > >
    > > Eliyahu
    > >
    > > "Jim" <> wrote in message
    > > news:...
    > > > Hi
    > > >
    > > > I placed a checkboxcontrol in a datagrid:
    > > >
    > > > <form id="Form1" method="post" runat="server">
    > > > <asp:DataGrid id="DataGrid1" style="Z-INDEX: 101; LEFT: 152px;

    > > POSITION:
    > > > absolute; TOP: 56px"
    > > > runat="server" Height="288px" Width="368px">
    > > > <Columns>
    > > > <asp:TemplateColumn>
    > > > <ItemTemplate>
    > > > <asp:TextBox ID="test" Text='<%#(DataBinder.Eval(Container,
    > > > DataItem.customerid"))%' Runat=server>
    > > > </asp:TextBox>
    > > > </ItemTemplate>
    > > > </asp:TemplateColumn>
    > > > </Columns>
    > > > </asp:DataGrid>
    > > > </form>
    > > >
    > > > the textbox is enclosed by the form tag so what could be wrong?
    > > >
    > > > ch Jim
    > > >
    > > >

    > >
    > >

    >
    >
     
    Rock, Jan 5, 2005
    #2
    1. Advertising

  3. Eliyahu Goldin

    Jim Guest

    thanks Rock but it still gives the error

    "Rock" <> schreef in bericht
    news:%23zq3a%...
    > You don't need parens around the DataBinder:
    >
    > <asp:TemplateColumn HeaderText="Validated">
    > <ItemTemplate>
    > <asp:textbox id=test
    > runat="server"
    > Text='<%#DataBinder.Eval(Container.DataItem,
    > "Validated") %>'>
    > </asp:textbox>
    >
    > </ItemTemplate>
    > </asp:TemplateColumn>
    >
    > "Jim" <> wrote in message
    > news:e%...
    >> i tried that then your textbox is gone!
    >>
    >> Jim
    >> "Eliyahu Goldin" <> wrote in message
    >> news:...
    >> > Try removing Runat=server from the textbox inside the template.
    >> >
    >> > Eliyahu
    >> >
    >> > "Jim" <> wrote in message
    >> > news:...
    >> > > Hi
    >> > >
    >> > > I placed a checkboxcontrol in a datagrid:
    >> > >
    >> > > <form id="Form1" method="post" runat="server">
    >> > > <asp:DataGrid id="DataGrid1" style="Z-INDEX: 101; LEFT: 152px;
    >> > POSITION:
    >> > > absolute; TOP: 56px"
    >> > > runat="server" Height="288px" Width="368px">
    >> > > <Columns>
    >> > > <asp:TemplateColumn>
    >> > > <ItemTemplate>
    >> > > <asp:TextBox ID="test" Text='<%#(DataBinder.Eval(Container,
    >> > > DataItem.customerid"))%' Runat=server>
    >> > > </asp:TextBox>
    >> > > </ItemTemplate>
    >> > > </asp:TemplateColumn>
    >> > > </Columns>
    >> > > </asp:DataGrid>
    >> > > </form>
    >> > >
    >> > > the textbox is enclosed by the form tag so what could be wrong?
    >> > >
    >> > > ch Jim
    >> > >
    >> > >
    >> >
    >> >

    >>
    >>

    >
    >
     
    Jim, Jan 6, 2005
    #3
  4. Eliyahu Goldin

    Jim Guest

    Hi

    I placed a checkboxcontrol in a datagrid:

    <form id="Form1" method="post" runat="server">
    <asp:DataGrid id="DataGrid1" style="Z-INDEX: 101; LEFT: 152px; POSITION:
    absolute; TOP: 56px"
    runat="server" Height="288px" Width="368px">
    <Columns>
    <asp:TemplateColumn>
    <ItemTemplate>
    <asp:TextBox ID="test" Text='<%#(DataBinder.Eval(Container,
    DataItem.customerid"))%' Runat=server>
    </asp:TextBox>
    </ItemTemplate>
    </asp:TemplateColumn>
    </Columns>
    </asp:DataGrid>
    </form>

    the textbox is enclosed by the form tag so what could be wrong?

    ch Jim
     
    Jim, Jan 6, 2005
    #4
  5. Looks like you are missing closing >.

    Eliyahu

    "Jim" <> wrote in message
    news:...
    > Hi
    >
    > I placed a checkboxcontrol in a datagrid:
    >
    > <form id="Form1" method="post" runat="server">
    > <asp:DataGrid id="DataGrid1" style="Z-INDEX: 101; LEFT: 152px;

    POSITION:
    > absolute; TOP: 56px"
    > runat="server" Height="288px" Width="368px">
    > <Columns>
    > <asp:TemplateColumn>
    > <ItemTemplate>
    > <asp:TextBox ID="test" Text='<%#(DataBinder.Eval(Container,
    > DataItem.customerid"))%' Runat=server>
    > </asp:TextBox>
    > </ItemTemplate>
    > </asp:TemplateColumn>
    > </Columns>
    > </asp:DataGrid>
    > </form>
    >
    > the textbox is enclosed by the form tag so what could be wrong?
    >
    > ch Jim
    >
    >
     
    Eliyahu Goldin, Jan 6, 2005
    #5
  6. Eliyahu Goldin

    Jim Guest

    i tried that then your textbox is gone!

    Jim
    "Eliyahu Goldin" <> wrote in message
    news:...
    > Try removing Runat=server from the textbox inside the template.
    >
    > Eliyahu
    >
    > "Jim" <> wrote in message
    > news:...
    > > Hi
    > >
    > > I placed a checkboxcontrol in a datagrid:
    > >
    > > <form id="Form1" method="post" runat="server">
    > > <asp:DataGrid id="DataGrid1" style="Z-INDEX: 101; LEFT: 152px;

    > POSITION:
    > > absolute; TOP: 56px"
    > > runat="server" Height="288px" Width="368px">
    > > <Columns>
    > > <asp:TemplateColumn>
    > > <ItemTemplate>
    > > <asp:TextBox ID="test" Text='<%#(DataBinder.Eval(Container,
    > > DataItem.customerid"))%' Runat=server>
    > > </asp:TextBox>
    > > </ItemTemplate>
    > > </asp:TemplateColumn>
    > > </Columns>
    > > </asp:DataGrid>
    > > </form>
    > >
    > > the textbox is enclosed by the form tag so what could be wrong?
    > >
    > > ch Jim
    > >
    > >

    >
    >
     
    Jim, Jan 6, 2005
    #6
  7. Eliyahu Goldin

    Jim Guest

    thanks E but this doesn't fix it either

    "Eliyahu Goldin" <> schreef in bericht
    news:...
    > Looks like you are missing closing >.
    >
    > Eliyahu
    >
    > "Jim" <> wrote in message
    > news:...
    >> Hi
    >>
    >> I placed a checkboxcontrol in a datagrid:
    >>
    >> <form id="Form1" method="post" runat="server">
    >> <asp:DataGrid id="DataGrid1" style="Z-INDEX: 101; LEFT: 152px;

    > POSITION:
    >> absolute; TOP: 56px"
    >> runat="server" Height="288px" Width="368px">
    >> <Columns>
    >> <asp:TemplateColumn>
    >> <ItemTemplate>
    >> <asp:TextBox ID="test" Text='<%#(DataBinder.Eval(Container,
    >> DataItem.customerid"))%' Runat=server>
    >> </asp:TextBox>
    >> </ItemTemplate>
    >> </asp:TemplateColumn>
    >> </Columns>
    >> </asp:DataGrid>
    >> </form>
    >>
    >> the textbox is enclosed by the form tag so what could be wrong?
    >>
    >> ch Jim
    >>
    >>

    >
    >
     
    Jim, Jan 7, 2005
    #7
  8. Hey Jim,

    You just need to put the quotes in the right places and not add extras. You
    have a quote after customerid" that shouldn't be there. Try this?

    <form id="Form1" method="post" runat="server">
    <asp:datagrid id="DataGrid1" style="Z-INDEX: 101; LEFT: 152px;
    POSITION: absolute; TOP: 56px"
    runat="server" Height="288px" Width="368px">
    <columns>
    <asp:templatecolumn>
    <itemtemplate>
    <asp:TextBox ID="test"
    Text='<%#(DataBinder.Eval(Container,DataItem.customerid))%>' Runat="server">
    </asp:textbox>
    </itemtemplate>
    </asp:templatecolumn>
    </columns>
    </asp:datagrid>
    </form>

    Ken
    Microsoft MVP [ASP.NET]

    "Jim" <> wrote in message
    news:...
    > Hi
    >
    > I placed a checkboxcontrol in a datagrid:
    >
    > <form id="Form1" method="post" runat="server">
    > <asp:DataGrid id="DataGrid1" style="Z-INDEX: 101; LEFT: 152px; POSITION:
    > absolute; TOP: 56px"
    > runat="server" Height="288px" Width="368px">
    > <Columns>
    > <asp:TemplateColumn>
    > <ItemTemplate>
    > <asp:TextBox ID="test" Text='<%#(DataBinder.Eval(Container,
    > DataItem.customerid"))%' Runat=server>
    > </asp:TextBox>
    > </ItemTemplate>
    > </asp:TemplateColumn>
    > </Columns>
    > </asp:DataGrid>
    > </form>
    >
    > the textbox is enclosed by the form tag so what could be wrong?
    >
    > ch Jim
    >
    >
     
    Ken Cox [Microsoft MVP], Jan 12, 2005
    #8
    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. Matthew Louden
    Replies:
    4
    Views:
    13,074
    Teemu Keiski
    Nov 18, 2003
  2. Tom wilson
    Replies:
    7
    Views:
    4,127
    William F. Robertson, Jr.
    Feb 10, 2005
  3. =?Utf-8?B?QWxpeHggU2tldmluZ3Rvbg==?=

    of type 'TextBox' must be placed inside a form tag with runat=serv

    =?Utf-8?B?QWxpeHggU2tldmluZ3Rvbg==?=, Apr 22, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    11,526
    =?Utf-8?B?QWxpeHggU2tldmluZ3Rvbg==?=
    Apr 22, 2005
  4. Replies:
    0
    Views:
    2,066
  5. Matthew Louden
    Replies:
    3
    Views:
    189
    Teemu Keiski
    Nov 18, 2003
Loading...

Share This Page