Because dojob()
is a server-side function, but onclick
on that input
element is a client-side event. You're probably getting an error in your JavaScript console saying that dojob()
is an undefined function.
Use an asp:Button
instead of an input
to make use of server-side click events. Also, dojob()
should be protected
. By not declaring a protection level I think the default is private
so the page controls might not even be able to see it. It should match the event handler for a button click:
protected void dojob(Object sender, EventArgs e)
{
}