views:

1643

answers:

2

I want to disable link button after clicking of it & other enable. toggle enable/ disable between both link buttons using c#

+1  A: 

Subscribe to Click event of this buttons and set Enabled property to true or false.

  void LinkButton_Click(Object sender, EventArgs e) 
  {
     // First enable all buttons
     btn1.Enabled = true;
     btn2.Enabled = true;

     // Then disable the clicked button
     (sender as Control).Enabled = false;

     ...
  }

This is just an example of how you can do this. Can be optimized...

masterik
A: 

To disable a link button you should assign false to its Enabled property:

button.Enabled = false;

There is also an example how to hook OnClick event in the linked MSDN article.

Alexander Prokofyev
my page contains links like this-<a href="page1">One</a><a href="page2">Two</a>so. how to do? using javascript or css?
Yogini
My answer was in therms of ASP.NET and C#. For Javascript answer you should reformulate the question.
Alexander Prokofyev