Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Dear Friends:
In ASP.NET i have created javascript function see the below coding
XML
<script language="javascript" type="text/javascript">
        function fnassignvalues() {
            <%Session["year"] = null; %>            
            window.location = "../Default.aspx";
        }
    </script>

and i called this function in the below coding
<a id="A2" onmousemove="" önclick="javascript: fnassignvalues()" font-bold="true" runat="server" forecolor="White"
style="color: #FFFFFF; font-weight: bold; cursor:pointer;">Sign Out

but the function raised before the button clicked, how could restrict the function should raised after button click event ?
Posted
Comments
Tom Marvolo Riddle 12-Dec-13 5:25am    
Not clear.If you want the function to raise after button click event, then call the function at Onclientclick
Ashok Nalam 12-Dec-13 5:52am    
make sure you do not have any callers to fnassignvalues other than önclick="javascript: fnassignvalues()". please provide more details.
peer mohammed.A 12-Dec-13 6:00am    
Yes am sure that no callers to fnassignvalues except onclick event...
ZurdoDev 12-Dec-13 8:18am    
You're using onmouseover not onclick
TryAndSucceed 12-Dec-13 15:23pm    
why do you even have onmousemove? Remove it and try again.

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