Solved

ASP.NET AJAX Modal Popup Execute Server code

Posted on 2008-10-13
1
2,469 Views
Last Modified: 2013-11-07
Here is my scenario I'm testing out the Modal Popup extender in the ASP.NET 2.0 AJAX Control Toolkit. I got the Modal Extendering working. However, I want to execute server side code once the user selects OK. I want the modal popup to disappear and execute the server side code.  Code snippet below


<asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" Style="display: none" Width="233px">

   <p>Are you sure you want to Continue</p>

   <br />

   <div align="center">

      <asp:Button ID="OkButton" runat="server" Text="OK" />

      <asp:Button ID="CancelButton" runat="server" Text="Cancel" />

   </div>

   </asp:Panel>

<ajaxToolkit:ModalPopupExtender ID="popup" runat="server" 

             TargetControlID="LinkButton1"

             PopupControlID="Panel1"

             BackgroundCssClass="modalBackground"

             DropShadow="true"

             OkControlID="OkButton"

             OnOkScript="onOk()"

             CancelControlID="CancelButton" />
 

<script type="text/javascript">

    function onOk()

    {

        

    }

</script>
 

Server code to execute

protected void LinkButton1_Click(object sender, EventArgs e)

    {

        Label1.Text = "You clicked me!";

    }

Open in new window

0
Comment
Question by:abussie
1 Comment
 

Accepted Solution

by:
abussie earned 0 total points
ID: 22710612
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now