ASP.NET AJAX:Ajax之ModalPopupExtender的後台調用

來源:互聯網
上載者:User

ModalPopupExtender 也可以實現在背景調用:

頁面代碼(Modified from www.asp.net/ajax):

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
   <title>Untitled Page</title>
   <link href="StyleSheet.css" rel="stylesheet" type="text/css" />
   <script type="text/javascript">
   var styleToSelect;
   function onOk() {
   document.getElementById('Paragraph1').className = styleToSelect;
   }
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<br />
<asp:LinkButton ID="LinkButton1" runat="server">Please click to select an alternate text style.</asp:LinkButton><br />
<br />
<div>
  <p id="Paragraph1">
   <a href="http://joeon.net"><span style="color: #3366cc">Joe Stagner</span></a>,
    a member of the Microsoft product team, builds a CascadingDropDown sample application
    that demonstrates two fundamental benefits of AJAX-enabled web applications, namely
    web service integration and asynchronous page updates.
  </p>
  <asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" Style="display: none" Width="233px">
  <p>Choose the style you would like:</p>
  <input id="RadioA" name="Radio" onclick="styleToSelect = 'sampleStyleA';" type="radio" />
  <label class="sampleStyleA" for="RadioA">Choose THIS Style.</label><br />
  <input id="RadioB" name="Radio" onclick="styleToSelect = 'sampleStyleB';" type="radio" />
  <label class="sampleStyleB" for="RadioB">Choose THIS Style.</label><br />
  <input id="RadioC" name="Radio" onclick="styleToSelect = 'sampleStyleC';" type="radio" />
  <label class="sampleStyleC" for="RadioC">Choose THIS Style.</label><br />
  <input id="RadioD" name="Radio" onclick="styleToSelect = 'sampleStyleD';" type="radio" />
  <label class="sampleStyleD" for="RadioD">Choose THIS Style.</label><br />
  <br />
  <div align="center">
    <asp:Button ID="OkButton" runat="server" Text="OK" />
    <asp:Button ID="CancelButton" runat="server" Text="Cancel" />
  </div>
  </asp:Panel>
   <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="後台顯示" />
  <br />
  </div>
</form>
</body>

</html>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.