Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7. using System.Data;
  8.  
  9. namespace WebEMR.CustomControls
  10. {
  11. public partial class nonpathological : System.Web.UI.UserControl
  12. {
  13. protected override void OnInit(EventArgs e)
  14. {
  15.  
  16.  
  17. base.OnInit(e);
  18. }
  19. protected void Page_Load(object sender, EventArgs e)
  20. {
  21. if (this.Visible)
  22. {
  23. InitSetup();
  24.  
  25. }
  26. }
  27. /// <summary>
  28. ///
  29. /// </summary>
  30. public void InitSetup()
  31. {
  32.  
  33.  
  34. string jQuery = "function Test(option_value) {alert(option_value);}";
  35. //ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Tobacco", jQuery, true);
  36.  
  37.  
  38. ScriptManager requestSM = ScriptManager.GetCurrent(this.Page);
  39. if (requestSM != null && requestSM.IsInAsyncPostBack)
  40. {
  41.  
  42. ScriptManager.RegisterClientScriptBlock(this,
  43. this.GetType(),
  44. Guid.NewGuid().ToString(),
  45. jQuery,
  46. true);
  47. }
  48. else
  49. {
  50.  
  51. this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(),
  52. Guid.NewGuid().ToString(),
  53. jQuery,
  54. true);
  55. }
  56.  
  57. }
  58.  
  59.  
  60. protected void rbTobacco_DataBound(object sender, EventArgs e)
  61. {
  62.  
  63.  
  64. }
  65.  
  66. protected void rbTobacco_PreRender(object sender, EventArgs e)
  67. {
  68. foreach (ListItem li in rbTobacco.Items)
  69. {
  70. li.Attributes.Add("onclick", "javascript:Test('" + li.Value + "');");
  71. }
  72. }
  73. }
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement