java client side

  • Thread starter Thread starter Frank
  • Start date Start date
F

Frank

Hi,

in a .net web appl (codebehind) when I push a button I want to do javascript
stuff on the CLIENT side and then go on with the codebehind coding of the
button (or maybe another proc) on the SERVER side.
Is that possible? I can't get it to work with doPostback
Thanks
Frank
 
Sub Page_Load()

yourControl.addHandler("eventHander", "clientFunction")

End Sub
 
Scott,
I put this in the HTML? So I have two page_loads, one in the HTML and one in
the codebehind?
Frank
 
No, your Page_Load should only exist in the codebhind. Since this is server
code and will execute before the final page is rendered, the instruction
here to add a client-side handler will be placed into the resulting HTML
element delivered to the client machine.
 
Scott,

that leaves me with the problem that I don't have the method addhandler for
the control. The control is defined as:

Protected WithEvents btnBestel As System.Web.UI.WebControls.Button

Intellisense doesn't show addhandler and putting it there anyway gives an
error.

Greets

Frank
 
Sorry Frank, it's

Button.Attributes.Add("onClick", "clientFunction()")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top