Click here to Skip to main content
15,888,461 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello dear friends

i have a code behind function \ mathod
VB
Public Sub Bind(ByVal sender As Object, ByVal e As EventArgs)
    msgbox("call")
End Sub

i want this function in java script's function how it's posible
JavaScript
<script type="text/javascript">

function keyPress(sender, e) {
    //i want to call code behin function hare 
    Bind(sender,e);
}
</script>

Thanks

pardeep barak
Posted
Updated 6-May-13 0:13am
v2
Comments
Prasad Khandekar 6-May-13 6:15am    
Unfortunately the answer is NO. Codebehind runs on the server side and javascript is going to get executed in the user's browser. Only way to call a server side method is to either use a postback or via webservice call.

Here on CodeProject you can find many articles written by well known authoris on this topic.

Regards,
ZurdoDev 6-May-13 10:17am    
Use jquery's ajax method and make a webservice. Better yet, looking at your code use the alert function in js. Windows and Web development are very, very different.

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