Posted: 7/15/2011
I have 2 link buttons with OnClientClick() & OnCommand() events
OnClientClick() i am opening a samll window
& OnCommand() event I want to know on which Linkbutton user has click
protected void LinkButton_Command(object sender, CommandEventArgs e)
{
if (e.CommandName == "Friend")
Session["type"] = "f";
}
if (e.CommandName == "Privatemessage")
Session["type"] = "p";
but my LinkButton_Command event is not firing
Please show the sufficient code to reproduce your issue.
Posted: 7/18/2011
Ok fine
my java script function is:-
script type="text/javascript">
function openRadWin()
radopen("friendrequest.aspx?","RadWindow1");
</script>
& on .aspx page i have 2 link buttons like this
<li>
<asp:LinkButton ID="LinkButton1" runat="server" OnClientClick="openRadWin(); return false;"oncommand="LinkButton_Command" CommandName="Friend"CausesValidation="False" >Add As a Friend
</asp:LinkButton>
</li>
<li >
<asp:LinkButton ID="LinkButton2" oncommand="LinkButton_Command"
OnClientClick="openRadWin(); return false;" runat="server"
CommandName="Privatemessage" CausesValidation="False">
Send Message</asp:LinkButton>
linkbutton commcnd event is
Hello,
There is nothing wrong with your code. I copied your code and ran it. The Command event is getting fired.
One of my collegue also faced the same issue. He just copied his code into the new page and it started working.
I would suggest you to do the same. Just copy and paste it in a new web form and then try to run it.
Hope this helps.
Thanks & Regards,
Sumit Arora
Hi Sumit,
Thanks,
I have coppied the code to another page & ran it but it still does not works
pallavi karpe said: but my LinkButton_Command event is not firing
pallavi karpe said: OnClientClick="openRadWin(); return false;"
OnClientClick="openRadWin(); return false;"
Posted: 7/19/2011
yes raghav you r right,
but when i say return true then rad window immegiately get closed
so wht to do to keep it open unless user close it
You must be having some button on your RAD modal. Write your logic on click of that button instead of command of link button.
Posted: 8/8/2011
Remove return false; from OnclientClick event.