Issues with TR and FormView data Bind when TR is Runat=Server

Discussion in 'ASP .Net' started by Daniel Jeffrey, Jul 17, 2008.

  1. Hello,

    I am using an ObjectDataSource with a Custom DataObject etc.

    Everything is working fine, except when I use a Bound control in a Table Row
    that is runat="server"

    As you can see below - i have commented out the code that causes this to
    fail. Eg when i remove <tr> and replace with the commented out line, the
    binding does not update.

    It works for showing the data, just not updating the CustomObject.

    Please help.


    <%--<tr style="text-align: left" runat="server" id="SiteTR">--%>
    <tr>
    <td>
    <strong>Site : </strong>
    </td>
    <td>
    <asp:DropDownList ID="SiteDropDown" runat="server"
    SelectedValue='<%# Bind("TXSITE") %>' DataSourceID="SiteDataSource"
    DataTextField="TXSITE" DataValueField="TXSITE" ></asp:DropDownList>
    </td>
    </tr>
     
    Daniel Jeffrey, Jul 17, 2008
    #1
    1. Advertising

  2. Daniel Jeffrey

    nick chan Guest

    have u tried placeholder instead? sorry not much experience here

    On Jul 17, 3:10 pm, "Daniel Jeffrey" <>
    wrote:
    > Hello,
    >
    > I am using an ObjectDataSource with a Custom DataObject etc.
    >
    > Everything is working fine, except when I use a Bound control in a Table Row
    > that is runat="server"
    >
    > As you can see below - i have commented out the code that causes this to
    > fail. Eg when i remove <tr> and replace with the commented out line, the
    > binding does not update.
    >
    > It works for showing the data, just not updating the CustomObject.
    >
    > Please help.
    >
    > <%--<tr style="text-align: left" runat="server" id="SiteTR">--%>
    > <tr>
    >     <td>
    >         <strong>Site : </strong>
    >     </td>
    >     <td>
    >         <asp:DropDownList ID="SiteDropDown" runat="server"
    > SelectedValue='<%# Bind("TXSITE") %>' DataSourceID="SiteDataSource"
    > DataTextField="TXSITE" DataValueField="TXSITE" ></asp:DropDownList>
    >     </td>
    > </tr>
     
    nick chan, Jul 17, 2008
    #2
    1. Advertising

  3. not but not sure how that would work

    pls be aware if I make the TD runat=server it works fine, just the TR
    strange hey !

    Dan

    "nick chan" <> wrote in message
    news:...
    > have u tried placeholder instead? sorry not much experience here
    >
    > On Jul 17, 3:10 pm, "Daniel Jeffrey" <>
    > wrote:
    >> Hello,
    >>
    >> I am using an ObjectDataSource with a Custom DataObject etc.
    >>
    >> Everything is working fine, except when I use a Bound control in a Table
    >> Row
    >> that is runat="server"
    >>
    >> As you can see below - i have commented out the code that causes this to
    >> fail. Eg when i remove <tr> and replace with the commented out line, the
    >> binding does not update.
    >>
    >> It works for showing the data, just not updating the CustomObject.
    >>
    >> Please help.
    >>
    >> <%--<tr style="text-align: left" runat="server" id="SiteTR">--%>
    >> <tr>
    >> <td>
    >> <strong>Site : </strong>
    >> </td>
    >> <td>
    >> <asp:DropDownList ID="SiteDropDown" runat="server"
    >> SelectedValue='<%# Bind("TXSITE") %>' DataSourceID="SiteDataSource"
    >> DataTextField="TXSITE" DataValueField="TXSITE" ></asp:DropDownList>
    >> </td>
    >> </tr>

    >
     
    Daniel Jeffrey, Jul 17, 2008
    #3
  4. Daniel Jeffrey

    nick chan Guest

    like this

    <asp:placeholder id="plc" runat="server">

    <tr>
    .
    .
    .
    .
    .
    </tr>

    </asp:placholder>

    On Jul 17, 7:12 pm, "Daniel Jeffrey" <>
    wrote:
    > not but not sure how that would work
    >
    > pls be aware if I make the TD runat=server it works fine, just the TR
    > strange hey !
    >
    > Dan
    >
    > "nick chan" <> wrote in message
    >
    > news:...
    >
    > > have u tried placeholder instead? sorry not much experience here

    >
    > > On Jul 17, 3:10 pm, "Daniel Jeffrey" <>
    > > wrote:
    > >> Hello,

    >
    > >> I am using an ObjectDataSource with a Custom DataObject etc.

    >
    > >> Everything is working fine, except when I use a Bound control in a Table
    > >> Row
    > >> that is runat="server"

    >
    > >> As you can see below - i have commented out the code that causes this to
    > >> fail. Eg when i remove <tr> and replace with the commented out line, the
    > >> binding does not update.

    >
    > >> It works for showing the data, just not updating the CustomObject.

    >
    > >> Please help.

    >
    > >> <%--<tr style="text-align: left" runat="server" id="SiteTR">--%>
    > >> <tr>
    > >> <td>
    > >> <strong>Site : </strong>
    > >> </td>
    > >> <td>
    > >> <asp:DropDownList ID="SiteDropDown" runat="server"
    > >> SelectedValue='<%# Bind("TXSITE") %>' DataSourceID="SiteDataSource"
    > >> DataTextField="TXSITE" DataValueField="TXSITE" ></asp:DropDownList>
    > >> </td>
    > >> </tr>
     
    nick chan, Jul 18, 2008
    #4
  5. Daniel Jeffrey

    nick chan Guest

    or have u tried

    Page.Databind on PageLoad?




    On Jul 17, 4:39 pm, nick chan <> wrote:
    > have u tried placeholder instead? sorry not much experience here
    >
    > On Jul 17, 3:10 pm, "Daniel Jeffrey" <>
    > wrote:
    >
    > > Hello,

    >
    > > I am using an ObjectDataSource with a Custom DataObject etc.

    >
    > > Everything is working fine, except when I use a Bound control in a Table Row
    > > that is runat="server"

    >
    > > As you can see below - i have commented out the code that causes this to
    > > fail. Eg when i remove <tr> and replace with the commented out line, the
    > > binding does not update.

    >
    > > It works for showing the data, just not updating the CustomObject.

    >
    > > Please help.

    >
    > > <%--<tr style="text-align: left" runat="server" id="SiteTR">--%>
    > > <tr>
    > >     <td>
    > >         <strong>Site : </strong>
    > >     </td>
    > >     <td>
    > >         <asp:DropDownList ID="SiteDropDown" runat="server"
    > > SelectedValue='<%# Bind("TXSITE") %>' DataSourceID="SiteDataSource"
    > > DataTextField="TXSITE" DataValueField="TXSITE" ></asp:DropDownList>
    > >     </td>
    > > </tr>
     
    nick chan, Jul 18, 2008
    #5
  6. thanks I will try these
    Dan

    "nick chan" <> wrote in message
    news:...
    > or have u tried
    >
    > Page.Databind on PageLoad?
    >
    >
    >
    >
    > On Jul 17, 4:39 pm, nick chan <> wrote:
    >> have u tried placeholder instead? sorry not much experience here
    >>
    >> On Jul 17, 3:10 pm, "Daniel Jeffrey" <>
    >> wrote:
    >>
    >> > Hello,

    >>
    >> > I am using an ObjectDataSource with a Custom DataObject etc.

    >>
    >> > Everything is working fine, except when I use a Bound control in a
    >> > Table Row
    >> > that is runat="server"

    >>
    >> > As you can see below - i have commented out the code that causes this
    >> > to
    >> > fail. Eg when i remove <tr> and replace with the commented out line,
    >> > the
    >> > binding does not update.

    >>
    >> > It works for showing the data, just not updating the CustomObject.

    >>
    >> > Please help.

    >>
    >> > <%--<tr style="text-align: left" runat="server" id="SiteTR">--%>
    >> > <tr>
    >> > <td>
    >> > <strong>Site : </strong>
    >> > </td>
    >> > <td>
    >> > <asp:DropDownList ID="SiteDropDown" runat="server"
    >> > SelectedValue='<%# Bind("TXSITE") %>' DataSourceID="SiteDataSource"
    >> > DataTextField="TXSITE" DataValueField="TXSITE" ></asp:DropDownList>
    >> > </td>
    >> > </tr>

    >
     
    Daniel Jeffrey, Jul 18, 2008
    #6
  7. placeholder worked great
    strange TR doesnt - think that is a bug

    Dan

    "Daniel Jeffrey" <> wrote in message
    news:...
    > thanks I will try these
    > Dan
    >
    > "nick chan" <> wrote in message
    > news:...
    >> or have u tried
    >>
    >> Page.Databind on PageLoad?
    >>
    >>
    >>
    >>
    >> On Jul 17, 4:39 pm, nick chan <> wrote:
    >>> have u tried placeholder instead? sorry not much experience here
    >>>
    >>> On Jul 17, 3:10 pm, "Daniel Jeffrey" <>
    >>> wrote:
    >>>
    >>> > Hello,
    >>>
    >>> > I am using an ObjectDataSource with a Custom DataObject etc.
    >>>
    >>> > Everything is working fine, except when I use a Bound control in a
    >>> > Table Row
    >>> > that is runat="server"
    >>>
    >>> > As you can see below - i have commented out the code that causes this
    >>> > to
    >>> > fail. Eg when i remove <tr> and replace with the commented out line,
    >>> > the
    >>> > binding does not update.
    >>>
    >>> > It works for showing the data, just not updating the CustomObject.
    >>>
    >>> > Please help.
    >>>
    >>> > <%--<tr style="text-align: left" runat="server" id="SiteTR">--%>
    >>> > <tr>
    >>> > <td>
    >>> > <strong>Site : </strong>
    >>> > </td>
    >>> > <td>
    >>> > <asp:DropDownList ID="SiteDropDown" runat="server"
    >>> > SelectedValue='<%# Bind("TXSITE") %>' DataSourceID="SiteDataSource"
    >>> > DataTextField="TXSITE" DataValueField="TXSITE" ></asp:DropDownList>
    >>> > </td>
    >>> > </tr>

    >>
     
    Daniel Jeffrey, Jul 18, 2008
    #7
    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. Hazzard
    Replies:
    2
    Views:
    586
    Yan-Hong Huang[MSFT]
    Jul 23, 2003
  2. Marina
    Replies:
    0
    Views:
    563
    Marina
    Jul 21, 2003
  3. mr2_93
    Replies:
    1
    Views:
    3,665
    mr2_93
    Oct 2, 2005
  4. David Thielen

    FormView/Repeater/ Eval(FormView data)

    David Thielen, Jun 16, 2006, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    711
    David Thielen
    Jun 16, 2006
  5. Victor Espina

    Bind() in FormView with server-side tables

    Victor Espina, Aug 13, 2008, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    274
Loading...

Share This Page