demo_ajax_cs.aspx
上传用户:lanchensha
上传日期:2022-02-27
资源大小:7530k
文件大小:2k
源码类别:

编辑器/阅读器

开发平台:

C#

  1. <%@Page Language="C#" ValidateRequest="false" ContentType="text/html"%>
  2. <%@Register TagPrefix="dntb" Namespace="DotNetTextBox" Assembly="DotNetTextBox"%>
  3. <script runat="server" language="C#">
  4. private void Page_Load(object sender, System.EventArgs e)
  5. {
  6. if (!IsPostBack)
  7. {
  8. WebEditor1.Text = "<a href=http://www.aspxcn.com.cn><img src='system_dntb/skin/xp/img/logo.gif' alt='DotNet中华网版权所有' width=260 height=60 border=0></a>";
  9. }
  10. }
  11. private void Button1_OnClick(object sender, System.EventArgs e)
  12. {
  13. label1.Text = "<hr><b>以下是DotNetTextBox控件提交的内容</b>:<br>"+ Server.HtmlDecode(Server.HtmlEncode(WebEditor1.Text));
  14. }
  15. private void Button2_OnClick(object sender, System.EventArgs e)
  16. {
  17. WebEditor1.Text="";
  18. }
  19. </script>
  20. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  21. <html xmlns="http://www.w3.org/1999/xhtml" >
  22. <head>
  23. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  24. <title>演示:Asp.net Ajax的应用例子(C#)</title>
  25. <style type="text/css">
  26. <!--
  27. body {
  28. font-size: 9pt;
  29. }
  30. hr {
  31. border: dotted #AFAFAF;
  32. }
  33. input {
  34. font-size: 9pt;
  35. border: 1px ridge #999999;
  36. background-color: #FFFFFF;
  37. cursor:pointer;
  38. }
  39. TABLE {
  40. FONT: 9pt 宋体,Verdana,Arial
  41. }
  42. -->
  43. </style>
  44. </head>
  45. <body>
  46.     <table align=center width="555">
  47.         <tr>
  48.             <td valign="top" style="width: 551px">
  49.                 <fieldset>
  50.                     <legend>演示说明</legend>&nbsp; &nbsp; 本例子演示DotNetTextBox控件应用Asp.Net 
  51.                     Ajax(无刷新效果)的技术,通过放置在UpdatePanel控件里就简易地让DotNetText控件实现无刷新的效果!</fieldset>
  52.             </td>
  53.         </tr>
  54.     </table>
  55.     <br />
  56. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  57.   <tr>
  58.     <td><form id="Form1" runat="server">
  59.     <asp:ScriptManager ID="ScriptManager1" runat="server">
  60.     </asp:ScriptManager>
  61.     <asp:UpdatePanel ID="UpdatePanel1" runat="server">
  62.     <ContentTemplate>
  63.     <center>
  64.     <dntb:WebEditor ID="WebEditor1" runat="server"/>
  65.               <asp:Button id="Button1"  OnClick="Button1_OnClick" runat="server" Text="提交内容"></asp:Button>
  66.           <asp:Button id="Button2"  OnClick="Button2_OnClick" runat="server" Text="清空内容"></asp:Button>
  67.           <br /></center>
  68.           <asp:label runat="server" ID="label1"></asp:label>
  69.     </ContentTemplate>
  70.     </asp:UpdatePanel>
  71.       </form></td>
  72.   </tr>
  73. </table>
  74. </body>
  75. </html>