Click here to Skip to main content
15,905,607 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can anyone help for this coding?

my doubt is,

We are having two buttons like submit and update, if click submit button then update button should get invisible.
at the same time if we want to perform update operation then submit button should be invisible.

thanks in advance.
Posted
Updated 11-Nov-11 18:33pm
v2
Comments
palraj001 12-Nov-11 0:35am    
why you are having two buttons. do the operation in one button by checking Text property of the button

if (btn1.Text=="Save")
{
}
else if (btn1.Text=="Update")
{
}
sathiyak 12-Nov-11 0:57am    
where we should
write this..........
Sam Path 12-Nov-11 1:17am    
It will be write on the button click event.

In the Click() of submit button, write
C#
btnUpdate.Visible = false;

In the same way, write
C#
btnSubmit.Visible = false;

in the Click() of update button
 
Share this answer
 
Something like that:

JavaScript
myButton.style.visibility="hidden";


In some cases

JavaScript
myButton.style.visibility="collapse";


For explanation of the usage and difference see, http://www.w3schools.com/cssref/pr_class_visibility.asp[^].

If you want this to happen on click of some button, do it in the event handler of the other button's onClick property, see http://www.w3schools.com/jsref/event_onclick.asp[^].

—SA
 
Share this answer
 
v2
Comments
koolprasad2003 12-Nov-11 0:32am    
To the point SA 5!
Sergey Alexandrovich Kryukov 12-Nov-11 0:56am    
Thank you, Prasad. Did you forget to vote?
--SA
In  btn_new button:
btn_Save.Visible=true

In btn_edit button:
btn_Update.Visible=true

or 

if (button1.Text=="Save") 
{
button1.Text="Update"
//insert code
}
else if  (button1.Text=="Update") 
{
button1.Text="Save"
//update code
}
 
Share this answer
 
write on button click event

if save button is click then update button is invisible like...

btnupdate.visible=false;

if update button is click then save button is invisible like...

btnsave.visible=false;
 
Share this answer
 
if you use this type of operation then when you click update button then hide or visible=false,or enability=false; the submit button in case of submit then use opposite above.
 
Share this answer
 
Comments
sathiyak 12-Nov-11 0:41am    
i cant understood clearly

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900