javascript - Calling a function through buttons in ASP.NET using VB -


i'm having issues calling function have defined when click button. example, function this:

<script runat = "server" language = "vb">  sub deletefunction()     response.write("hello test test") end sub  </script> 

this within <head> tags. in <body> tags, have this:

<form method = "post" action = "hubpage.aspx">     <input type = "submit" value = "delete" onclick = "<% deletefunction() %>"> </form> 

that doesn't work because calls function without me ever having click button. tried this:

<form method = "post" action = "hubpage.aspx" onsubmit = "<% deletefunction() %>">     <input type = "submit" value = "delete"> </form> 

however, calls function regardless.

can point me in right direction?

you can remove onclick event , in .net code call javascript code

page.clientscript.registerstartupscript(me.gettype, nothing, "functionname();", true) 

Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -