[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

ASP.NET AJAX Modal Popup Execute Server code

Posted on 2008-10-13
1
Medium Priority
?
2,490 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
abussie earned 0 total points
ID: 22710612
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Thoughout my experience working on eCommerce web applications I have seen applications succumbing to increased user demand and throughput. With increased loads the response times started to spike, which leads to user frustration and lost sales. I ha…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
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…

649 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