473,485 Members | 1,457 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Visibility of link button

My following code is not working

I have a gridview that contains a linkButton in a template field. I
want to set the visibility of the linkbutton based on a int field in a
database.

Selecting the proper field in editbindings gives this in the code
<asp:LinkButton ID="btnRemoveAll" runat="server"
Visible='<%#(int.parse(Eval("UserCnt")!=0)) %>'
OnClick="btnRemoveAll_Click">Remove All</asp:LinkButton><br />
(where UserCnt is int field in my database)

This generates the following error.
'int' does not contain a definition for 'parse'

Sep 15 '07 #1
3 3280
On Sep 15, 3:28 am, bobby <bo...@discussions.microsoft.comwrote:
My following code is not working

I have a gridview that contains a linkButton in a template field. I
want to set the visibility of the linkbutton based on a int field in a
database.

Selecting the proper field in editbindings gives this in the code

<asp:LinkButton ID="btnRemoveAll" runat="server"
Visible='<%#(int.parse(Eval("UserCnt")!=0)) %>'
OnClick="btnRemoveAll_Click">Remove All</asp:LinkButton><br />
(where UserCnt is int field in my database)

This generates the following error.
'int' does not contain a definition for 'parse'
Hi bobby,

Insted of int.parse try to use Convert.ToInt32 method.

Regards,
Alexander Kleshchevnikov
www.klalex.com

Sep 15 '07 #2
The code is case sensitive. Try, int.Parse with a capital "P".

"bobby" wrote:
My following code is not working

I have a gridview that contains a linkButton in a template field. I
want to set the visibility of the linkbutton based on a int field in a
database.

Selecting the proper field in editbindings gives this in the code
<asp:LinkButton ID="btnRemoveAll" runat="server"
Visible='<%#(int.parse(Eval("UserCnt")!=0)) %>'
OnClick="btnRemoveAll_Click">Remove All</asp:LinkButton><br />
(where UserCnt is int field in my database)

This generates the following error.
'int' does not contain a definition for 'parse'
Sep 17 '07 #3
On Sep 14, 10:01 pm, seigo <seigo...@gmail.comwrote:
On Sep 15, 3:28 am, bobby <bo...@discussions.microsoft.comwrote:
My following code is not working
I have a gridview that contains a linkButton in a template field. I
want to set the visibility of the linkbutton based on a int field in a
database.
Selecting the proper field in editbindings gives this in the code
<asp:LinkButton ID="btnRemoveAll" runat="server"
Visible='<%#(int.parse(Eval("UserCnt")!=0)) %>'
OnClick="btnRemoveAll_Click">Remove All</asp:LinkButton><br />
(where UserCnt is int field in my database)
This generates the following error.
'int' does not contain a definition for 'parse'

Hi bobby,

Insted of int.parse try to use Convert.ToInt32 method.

Regards,
Alexander Kleshchevnikovwww.klalex.com
it could be looking for int.Parse (capital P)?

Sep 17 '07 #4

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

Similar topics

4
2802
by: Jonathan | last post by:
Hi, I've read through quite a number of postings on here so far and have seen what look like very simply, reasonable answers to this question, however I am still completely unable to do what I...
3
7563
by: Peter Schlenker | last post by:
In a navigation panel I try to place a bullet before each entry when the link is hovered at (see http://www.shambhala.de). Mozilla does it like expected, but IE doesn't - any ideas? <a...
1
6377
by: Micky Pearce | last post by:
Hi I have a page containing a hidden <div> called 'controls' plus an <iframe> containing a second page. I need to be able to set the visibility of the 'controls' div when the page in the iframe...
3
2268
by: torbs | last post by:
Hi I have two quicktime plugins embedded in a webpage. I want to hide one and display the other. Then I want to load a movie into the hidden player. When the first player is finished playing, I...
1
1628
by: BIOSMonkey | last post by:
I am trying to develop a drop down menu control. I know there are many other scripts out there but I need to develop our own in house for licensing purposes. Anyway, I am in the beginning stages...
11
2597
by: -D- | last post by:
How can I turn the visibility of the xml control on or off? <%@ Control Language="c#" AutoEventWireup="false" Codebehind="TopNavBar.ascx.cs" Inherits="compass.user_controls.TopNavBar"...
0
3464
by: Michel Couche | last post by:
Hello, I would like to programmatically set the visibility of a selectedWizardStep after clicking on a button contained in an other one. I found the following in an article from D. Esposito...
0
1216
by: Rocky | last post by:
Dear ALL, I am facing a bit problem in DATAGRID. so may be you guys can help me out. Actually on a DataGrid I am having following controls: 1) 2 DropDown Menu 2) 1 Text Box 3) 1 ADD Button 4)...
1
6412
by: msg2ajay | last post by:
hi, i am working on <div> i have to hide some part of the table. I am not able to hide that table part can anybady tell me where is the error. <html> <head> <script...
0
7090
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
6960
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
7116
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6825
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...
1
4857
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4551
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3058
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
1376
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
247
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.