.NET 2.0: DataLlist with nested LinkButton

Discussion in 'ASP .Net' started by R.A.M., Jun 26, 2006.

  1. R.A.M.

    R.A.M. Guest

    Hello,
    Please help me in simple problem. I defined DataList, FooterTemplate
    with nested asp:LinkButton, and command handler procedure:

    <asp:DataList ID="BooksList" runat="server"
    OnEditCommand="BooksList_Edit"
    OnUpdateCommand="BooksList_Update"
    OnCancelCommand="BooksList_Cancel"
    OnDeleteCommand="BooksList_Delete">
    ...
    <FooterTemplate>
    </tbody>
    <tfoot>
    <tr align="justify">
    <td>
    <asp:LinkButton ID="BooksLisAdd"
    runat="server" Text="Add" CommandName="Add"
    OnCommand="BooksListAdd_Add" />
    </td>
    </tr>
    </tfoot>
    </table>
    </FooterTemplate>
    </asp:DataList>

    protected void BooksListAdd_Add(object sender, CommandEventArgs e)
    {
    ...
    BooksListAdd.Visible = false; // HERE ERROR: "The
    name 'BooksListAdd' does not exist in the current context."
    }

    Could you explain me please the error and how to solve it?
    Thank you very much
    /RAM/
     
    R.A.M., Jun 26, 2006
    #1
    1. Advertising

  2. R.A.M.

    Bhuvana Guest

    Hi,

    Instead of accessing like BooksListAdd.Visible = false; you could use
    the below statement to hide the link button.

    ((LinkButton)sender).Visible = false;

    Regards,
    -Bhuvana
    www.syncfusion.com
     
    Bhuvana, Jun 26, 2006
    #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. aaapaul
    Replies:
    3
    Views:
    440
    Martin Marinov
    Jun 21, 2004
  2. Sathyaish
    Replies:
    3
    Views:
    3,169
    Sathyaish
    Sep 8, 2005
  3. R.A.M.
    Replies:
    0
    Views:
    473
    R.A.M.
    Jun 12, 2006
  4. R.A.M.
    Replies:
    0
    Views:
    381
    R.A.M.
    Jun 21, 2006
  5. Sathyaish

    Linkbutton does not look like a linkbutton

    Sathyaish, Sep 8, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    217
    Sathyaish
    Sep 8, 2005
Loading...

Share This Page