2.0: accessing control in FooterTemplate of asp:DataList

R

R.A.M.

Hello,
I need your help in a problem of putting and accessing asp control in
FooterTemplate of asp:DataList. I created a DataList:

<asp:DataList ID="BooksList" runat="server"
OnEditCommand="BooksiList_Edit"
OnUpdateCommand="BooksiList_Update"
OnDeleteCommand="BooksList_Delete">
....
<FooterTemplate>
</tbody>
<tfoot>
<tr align="justify">
<td>
<asp:LinkButton ID="BooksListAdd" runat="server"
Text="Add" CommandName="Add"
OnCommand="BooksList_Add" />
</td>
</tr>
</tfoot>
</table>
</FooterTemplate>
</asp:DataList>

I want to use LinkButton in hander function:

protected void BooksList_Add(object sender, DataListCommandEventArgs
e)
{
...
BooksListAdd.Visible = false;
}

but I receive an error: "The name 'BooksListAdd' does not exist in the
current context."
How to write it correctly?
Thank you very much for your help.
/RAM/
 
N

nasirmajor

R.A.M. said:
Hello,
I need your help in a problem of putting and accessing asp control in
FooterTemplate of asp:DataList. I created a DataList:

<asp:DataList ID="BooksList" runat="server"
OnEditCommand="BooksiList_Edit"
OnUpdateCommand="BooksiList_Update"
OnDeleteCommand="BooksList_Delete">
...
<FooterTemplate>
</tbody>
<tfoot>
<tr align="justify">
<td>
<asp:LinkButton ID="BooksListAdd" runat="server"
Text="Add" CommandName="Add"
OnCommand="BooksList_Add" />
</td>
</tr>
</tfoot>
</table>
</FooterTemplate>
</asp:DataList>

I want to use LinkButton in hander function:

protected void BooksList_Add(object sender, DataListCommandEventArgs
e)
{
...
BooksListAdd.Visible = false;
}

but I receive an error: "The name 'BooksListAdd' does not exist in the
current context."
How to write it correctly?
Thank you very much for your help.
/RAM/


the error that i think is that you bookslistadd.visible=false; within
the body of
procedure.try it with this statement outside the procedure body
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top