Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Data;
- namespace WebEMR.CustomControls
- {
- public partial class nonpathological : System.Web.UI.UserControl
- {
- protected override void OnInit(EventArgs e)
- {
- base.OnInit(e);
- }
- protected void Page_Load(object sender, EventArgs e)
- {
- if (this.Visible)
- {
- InitSetup();
- }
- }
- /// <summary>
- ///
- /// </summary>
- public void InitSetup()
- {
- string jQuery = "function Test(option_value) {alert(option_value);}";
- //ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Tobacco", jQuery, true);
- ScriptManager requestSM = ScriptManager.GetCurrent(this.Page);
- if (requestSM != null && requestSM.IsInAsyncPostBack)
- {
- ScriptManager.RegisterClientScriptBlock(this,
- this.GetType(),
- Guid.NewGuid().ToString(),
- jQuery,
- true);
- }
- else
- {
- this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(),
- Guid.NewGuid().ToString(),
- jQuery,
- true);
- }
- }
- protected void rbTobacco_DataBound(object sender, EventArgs e)
- {
- }
- protected void rbTobacco_PreRender(object sender, EventArgs e)
- {
- foreach (ListItem li in rbTobacco.Items)
- {
- li.Attributes.Add("onclick", "javascript:Test('" + li.Value + "');");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement