470,641 Members | 1,566 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,641 developers. It's quick & easy.

TextBox and Button Visible true or false problem

hi
I am creating travels project, in left part of my datagrid of my default page i placed all the products such as india tour ,world tour etc and if v click any product it will redirect to itennary page according to their ID's
my problem is i inserted new product as Hotel Booking and i want to place textbox and a button in the itenary page and if v click india tour or world tour i want those textbox and button should be not visible and if v click Hotel booking then those textbox and button should visible
Please solve my problem its urgent.
Thank you in advance
raghu
Feb 11 '08 #1
4 2339
int08h
28
in Page_Load method
protected void Page_Load()
{
//Only an example, use your way to get ID
int id = int.Parse(Request.QueryString["ID"]);

if (id == "world tour") //etc...
{
TextBox1.Visible = false;
Button1.Visible = false;
}
}
Feb 11 '08 #2
Sorry i am getting error near
if (id == "world tour")
Error 1 Operator '==' cannot be applied to operands of type 'int' and 'string'
Feb 11 '08 #3
priyamv
17
You have to check for the id from the querry string

if id from querry string =Hotelmgt id then

textbox.visible=true
Buttonid.visible=true

else

textbox.visible=false
Buttonid.visible=false
Feb 11 '08 #4
sorry still i am not able to get can u please give me the code in c#
Feb 11 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Rodrigo DeJuana | last post: by
2 posts views Thread by A. Nonymous | last post: by
5 posts views Thread by hanolo | last post: by
2 posts views Thread by bindurajeesh | last post: by
???
1 post views Thread by Stoney L | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.