server side kepress event on textbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

HI There,

I have a webform and I am wanting to call a function from a textbox control
located on the webform when a key is pressed. Can this be done in server side.
already know do like this

on ASPX page within javascript tags
<script laguage=javascript>
function trapKeypress() {
alert (window.event.keyCode);
}
</script>

and in .vb page of the .aspx page ..'
textbox1.attributes.item("onkeypress") = "javascript:trapKeypress();"

Can I do it without using JavaScript .

Regards
 
You can submit the form in trapKeypress(). This will cause a postback and
you can pass to the server a sort of info telling what exactly caused the
postback. This will resemble a server event. You can't avoid using
javascript on the client side. How can server know what is happening in the
browser?

Eliyahu
 
Back
Top