Click here to Skip to main content
15,911,786 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Friends,

I have a problem with my link button's please help me my problem is -

My link button's are:
Inbox()
send mail()
draft()
checked Ails()

When I am clicking the one link button(inbox), it redirect to inbox but other three buttons should work and the clicked button inbox should not work.

Please help me and im doing like this.

Link button enable =true and on click =false but its not working please send me the code if it is in JavaScript also.


Thanks and Regards,
Divya
Posted
Updated 22-Dec-11 22:06pm
v2

C#
<asp:LinkButton ID="Button1" runat="server" Text="Button1" onclick="Button1_Click" />
        <asp:LinkButton ID="Button2" runat="server" Text="Button2" onclick="Button2_Click" />



C#
protected void Button1_Click(object sender, EventArgs e)
   {
       Button1.Enabled = false;
       Button2.Enabled = true;
   }
   protected void Button2_Click(object sender, EventArgs e)
   {
       Button2.Enabled = false;
       Button1.Enabled = true;
   }



Hope this is what u wanted
 
Share this answer
 
v2
When you click on any link. call javascript.
1. set any indicator in hiddenfield with link name.
2. when you again click on same link check for hiddenfield value. if it is same like clicked link. just return false.
hidden field is client side statemenegment, persist data after postback.
 
Share this answer
 
Koolprasad solution is good according to your requirement and in additional you can do this :

set any status on page. if

C#
lnkInbox_Click()
{
status=1;
//code here
}
else if()// add condition
{
////so on.
}


according to that check the condition. and set link button visible = true or false.
if you have any doubt then feel free to ask...
 
Share this answer
 
v2

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