Solved

ASP.NET AJAX Modal Popup Execute Server code

Posted on 2008-10-13
1
2,463 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
Comment Utility
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

OverviewThis article demonstrates a simple search form using AJAX. The purpose of the article is to demonstrate how to use the same code to render a page and javascript (JQuery) and AJAX to make subsequent calls to refine the results. The princip…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
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.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

744 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

17 Experts available now in Live!

Get 1:1 Help Now