Textbox and button visible true or false problem

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2007
Posts: 40
Reputation: raghu.8 is an unknown quantity at this point 
Solved Threads: 0
raghu.8 raghu.8 is offline Offline
Light Poster

Re: Textbox and button visible true or false problem

 
0
  #11
Feb 12th, 2008
Sorry i am getting error near
if (id == "world tour")
Error 1 Operator '==' cannot be applied to operands of type 'int' and 'string'
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 1,181
Reputation: hollystyles will become famous soon enough hollystyles will become famous soon enough 
Solved Threads: 67
hollystyles's Avatar
hollystyles hollystyles is offline Offline
Veteran Poster

Re: Textbox and button visible true or false problem

 
0
  #12
Feb 12th, 2008
That's right the variable id is an integer, "world tour" is a string literal you cannot apply the == operator to these different types.

I can see you are either very very green or a forum troll. If the former you need to get a book on basic programming. One that starts from the beginning explaining types and stuff. If the latter I'm done here.
==========================================
Yadda yadda yadda...
Web junky, fevered monkey
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 40
Reputation: raghu.8 is an unknown quantity at this point 
Solved Threads: 0
raghu.8 raghu.8 is offline Offline
Light Poster

Re: Textbox and button visible true or false problem

 
0
  #13
Feb 12th, 2008
actually i was totally confused
some times mistake happens
Last edited by raghu.8; Feb 12th, 2008 at 6:56 am.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 40
Reputation: raghu.8 is an unknown quantity at this point 
Solved Threads: 0
raghu.8 raghu.8 is offline Offline
Light Poster

Re: Textbox and button visible true or false problem

 
0
  #14
Feb 12th, 2008
still i am getting the same error,when i given hotel booking ID
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 1,181
Reputation: hollystyles will become famous soon enough hollystyles will become famous soon enough 
Solved Threads: 67
hollystyles's Avatar
hollystyles hollystyles is offline Offline
Veteran Poster

Re: Textbox and button visible true or false problem

 
0
  #15
Feb 12th, 2008
You're very close. You have the ID, you need a function in itenary.aspx.cs you can pass the ID too, the function should look the ID up and see if it's the hotel booking catagory and return true or false

  1. public class itinery
  2. {
  3. //all your existing code blah...
  4. private bool IsHotelBooking( int catId)
  5. {
  6. //connect to db pass catId as parameter
  7. //somrthing like string catName = command.ExecuteScalar();
  8. if(catName == "hotel booking")
  9. return true;
  10. else
  11. return false;
  12. }
==========================================
Yadda yadda yadda...
Web junky, fevered monkey
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 1,181
Reputation: hollystyles will become famous soon enough hollystyles will become famous soon enough 
Solved Threads: 67
hollystyles's Avatar
hollystyles hollystyles is offline Offline
Veteran Poster

Re: Textbox and button visible true or false problem

 
0
  #16
Feb 12th, 2008
still i am getting the same error,when i given hotel booking ID

Don't put the hotel booking id in quotes (I'm guessing that's what you've done). And hard coding an ID into your program logic is very poor, but I guess there's time for that later when you've learned more.
==========================================
Yadda yadda yadda...
Web junky, fevered monkey
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 40
Reputation: raghu.8 is an unknown quantity at this point 
Solved Threads: 0
raghu.8 raghu.8 is offline Offline
Light Poster

Re: Textbox and button visible true or false problem

 
0
  #17
Feb 12th, 2008
Is there any posible that i can attach my sample project to this reply box so that you can understand
raghu
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 1,181
Reputation: hollystyles will become famous soon enough hollystyles will become famous soon enough 
Solved Threads: 67
hollystyles's Avatar
hollystyles hollystyles is offline Offline
Veteran Poster

Re: Textbox and button visible true or false problem

 
0
  #18
Feb 12th, 2008
I do understand. But yes you can attach it. Click the Go Advanced button below the reply box. You'll get a bigger editor. SCroll the page down a bit and there's a manage attachments button.
==========================================
Yadda yadda yadda...
Web junky, fevered monkey
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 40
Reputation: raghu.8 is an unknown quantity at this point 
Solved Threads: 0
raghu.8 raghu.8 is offline Offline
Light Poster

Re: Textbox and button visible true or false problem

 
0
  #19
Feb 12th, 2008
i
Last edited by raghu.8; Feb 12th, 2008 at 8:27 am.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C# Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC