0

I move my js code to jQuery and jQuery UI. I have a problem with the dialog plugin.
Up to now I have used YUI where ther I have to write the buttons of my own. Therefore I was able to use server side buttons (<asp:Button runat="server" ... />) of my own and pass an id to the YUI plugin.
Now, in jQuery UI dialog, in order to add buttons I must pass an option like this:

buttons:{
    nameOfButton:function () {
        //what to do when clicked
    }
}

How should I treat to asp.NET buttons which has server events (MyButton.Click += ....) and used in server side (in my aspx.cs I have used those buttons)?
How can I use them in the jQuery UI dialog?

Naor
  • 23,465
  • 48
  • 152
  • 268
  • What's the question/problem you're asking about specifically? – McGarnagle Apr 01 '12 at 07:16
  • How do I add an existing asp.net button to jquery dialog? – Naor Apr 01 '12 at 07:19
  • hiya if you are wondering about how to bind the dynamic generated button id "ctl100_..." read some stuff here: http://stackoverflow.com/questions/716827/jquery-click-event-on-aspbutton , cheerios! – Tats_innit Apr 01 '12 at 07:21
  • @Tats_innit: I am wondering how to add an existing asp.net button to jquery dialog. Not how to bind the dynamic generated button id. – Naor Apr 01 '12 at 07:24
  • aaaaa.... got it lol :) I got it now, srry man! will take a look now. – Tats_innit Apr 01 '12 at 07:24
  • @Naor so you still want the button to post back to the server and run its ASP.NET handler, is that right? The point of the JQuery UI is just to change how it looks? – McGarnagle Apr 01 '12 at 07:25
  • @dbaseman: Yes. I need the button to stay on server side and somehow connect the button to the dialog. I there such way of doing so? – Naor Apr 01 '12 at 07:37
  • 1
    http://stackoverflow.com/questions/757232/jquery-ui-dialog-with-asp-net-button-postback ?? this might help, cheerios! – Tats_innit Apr 01 '12 at 07:41
  • @Naor there should be... I agree with Tats_innit. The problem is that ASP.NET does some behind-the-scenes stuff to link up its event handlers, which JQuery stuff can potentially break. – McGarnagle Apr 01 '12 at 07:45
  • @Tats_innit: I saw that.. I think that there the user wanted to add the content and not buttons. I think that this is other question. – Naor Apr 01 '12 at 07:48

1 Answers1

0

you can add click event to binding a javascript function like this:

<asp:Button runat="server" OnClick="buttonClick"... /> 
Dozer
  • 5,025
  • 11
  • 36
  • 52