Solved

ASP.NET AJAX Modal Popup Execute Server code

Posted on 2008-10-13
1
2,473 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Using Quotation Marks in PHP This question (http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_28217211.html) seems to come up a lot for developers who are new to PHP.  And it got me thinking, "How can we explain the rule…
If I have to fix slow responding website my first thoughts are server side optimizations: the database may not be optimized or caching is not enabled, or things like that. We often overlook another major part of our web application: the client. We o…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

803 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