Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / September 2007

Tip: Looking for answers? Try searching our database.

link button

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bobby - 15 Sep 2007 01:20 GMT
My following code is not working

<asp:LinkButton ID="btnRemoveAll" runat="server"  
Visible='<%#(int.parse(Eval("UserCnt")!=0)) %>'
OnClick="btnRemoveAll_Click">Remove All</asp:LinkButton><br />
Nathan Sokalski - 15 Sep 2007 02:12 GMT
It looks to me like you might have your parentheses misplaced. Try changing
your databinding expression to the following:

'<%#(int.parse(Eval("UserCnt"))!=0) %>'

It can sometimes be a little tricky doing calculation inside databinding
expressions. If you haven't done it already, I would do a few tests to make
sure that the specific pieces of the expression are returning what you
expect (For example, make sure Eval("UserCnt") and
int.parse(Eval("UserCnt")) return what you expect). Also, because Eval
returns an Object and parse accepts a String, you may want to cast
Eval("UserCnt") as a String before sending it to parse. I won't make any
promises that any of these will work, but hopefully they will be worth
something. Good Luck!
Signature

Nathan Sokalski
njsokalski@hotmail.com
http://www.nathansokalski.com/

> My following code is not working
>
> <asp:LinkButton ID="btnRemoveAll" runat="server"
> Visible='<%#(int.parse(Eval("UserCnt")!=0)) %>'
> OnClick="btnRemoveAll_Click">Remove All</asp:LinkButton><br />

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.