UpdateButtonInside.aspx 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <%@ Page Language="C#" %>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <script runat="server">
  4. protected void Page_Load(object sender, EventArgs e)
  5. {
  6. if (!IsPostBack)
  7. {
  8. if (ConfigurationManager.AppSettings["RenameID"] != null)
  9. {
  10. bool doRename = bool.Parse(ConfigurationManager.AppSettings["RenameID"]);
  11. if (doRename)
  12. {
  13. //Button1.ID = "abcd:" + Button1.ID;
  14. }
  15. }
  16. }
  17. }
  18. protected void Button1_Click(object sender, EventArgs e)
  19. {
  20. xyz_Label1.Text = "Refreshed at " +
  21. DateTime.Now.ToString();
  22. }
  23. </script>
  24. <html xmlns="http://www.w3.org/1999/xhtml" >
  25. <head id="Head1" runat="server">
  26. <title>Untitled Page</title>
  27. <style type="text/css">
  28. #UpdatePanel1 {
  29. width:300px; height:100px;
  30. }
  31. </style>
  32. </head>
  33. <body runat="server">
  34. <form id="xyz_form1" runat="server">
  35. <div style="padding-top: 10px">
  36. <asp:ScriptManager ID="xyz_ScriptManager1" runat="server">
  37. </asp:ScriptManager>
  38. <asp:UpdatePanel ID="xyz_UpdatePanel1" runat="server">
  39. <ContentTemplate>
  40. <fieldset>
  41. <legend>UpdatePanel</legend>
  42. <asp:Label ID="xyz_Label1" runat="server" Text="Panel created."></asp:Label><br />
  43. <asp:Button ID="xyz_Button1" runat="server" OnClick="Button1_Click" Text="Button" />
  44. </fieldset>
  45. </ContentTemplate>
  46. </asp:UpdatePanel>
  47. <br />
  48. </div>
  49. </div>
  50. <input type="hidden" id="__PAGENAMESPACE" value="xyz" />
  51. </form>
  52. </body>
  53. </html>