473,513 Members | 2,654 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

2.0: accessing control in FooterTemplate of asp:DataList

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/

Jun 8 '06 #1
2 1805

R.A.M. wrote:
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

Jun 8 '06 #2

na********@yahoo.com wrote:
R.A.M. wrote:
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/


visit it may be it helps you
http://aspnet.4guysfromrolla.com/articles/032203-1.aspx

Jun 8 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1272
by: Chris Fink | last post by:
Hello, I have an ASP Datalist in which I am binding a value within the <itemtemplate> section as follows: <%# DataBinder.Eval(Container.DataItem, "week")%> This displays the week value as...
3
2621
by: Harry | last post by:
Hi, Can anyone tell me why the below code does not work. I dont get any errors, but nor does the Text for the asp:label get set. Thanks in advance as always H
8
653
by: MattB | last post by:
I think I'm close to making this work, but so far it does not. I have a datalist (id = "dlVFields") on a web form that has an item template with a textbox in it. The textbox id = "txtVerify"....
2
8721
by: Chris Fink | last post by:
This should be relatively simple but I am unable to find an asp:button tag in a datalist footer. I have tried it numerous ways including the FindControl method from the many events that the...
6
2178
by: tshad | last post by:
I need to get to a status label I have on my footer section of my datalist. There is no event happening that would go to the footer. I am just doing some processing and want to update the label...
8
5881
by: bienwell | last post by:
Hi, I have a problem of displaying data bound by a datalist control. In my table, I have a field Start_date which has Short Date data type. I tried to update this field by Current Date. After...
1
1711
by: Mia Williams via .NET 247 | last post by:
(Type your message here) I have user control (listpanel control) and I ahve to display the search results inside the list panel user control.. how can I do that? Can i access the list panel control...
3
2790
by: jjack100 | last post by:
I have a form that is submitted to another page. The form contains a variable number of dropdownlists within a repeater. When the form is submitted, I need to access the values of each...
0
899
by: Savas Ates | last post by:
I have a simple Data list control in my user control. When I run my main page and i use response.write to see grid query it writes 2 times. I checked my query results it is true. My datalist doesnt...
0
7257
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7157
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7535
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5682
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3232
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
455
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.