views:

1118

answers:

1

Currently I'm using jQuery on my asp.net content page (using master). I am creating a modal dialog using jquery. The div that is defined with the following code

<div id="example" class="flora" title="Information" style="display:none; visibility:hidden; text-align:left;">
        <asp:Panel ID="Panel" runat="server">
            Is the information you have entered correct?<br />
            <asp:Label>Some labels filled when the modal appears</asp:Label> 
            <asp:button runat="server" OnClick="someServerSide_Function" Text="Submit" />
        </asp:Panel>
  </div>

There is a HTML button that gets pressed, and when the button is pressed, it calls the following code

$("#example").dialog("open");

And the modal is defined with the following code:

$("#example").dialog({
                autoOpen: false, 
                modal: true,
                height: 400,
                overlay: overlayCss,
                bgiframe: true
            });

The Modal gets filled when the HTML button is clicked, and the ASP.NET button does not call its server side function when it is clicked. The Example div resides inside of the tags, so it should be calling the server side function. What could be wrong?

+3  A: 

Not nearly enough info to help you probably... but try this link.

http://encosia.com/2008/05/29/using-jquery-to-directly-call-aspnet-ajax-page-methods/

Edit:

It appears this question has been edited so I will edit my answer...

Use the above if you are wanting your button to call the serverside method from jquery without posting the page.

It now appears that you would be correctly calling a server-side method. (the whole page would submit.)

Have you set a break point in your serverside method and make sure that its being called (debugging)?

There really could be a lot wrong without seeing more of your code-behind.

You could also wire up the page with the Onit event with something like

this.Button1+=new EventHandler(Button1_Click);

(After giving your button an ID of "Button1")

Jeff Martin