protected void ajaxManager_AjaxRequest(object sender, AjaxRequestEventArgs e) { if (e.Argument == "mobile") { RadMenu menu = (RadMenu)WebUserControl1.FindControl("menu"); menu.RenderMode = RenderMode.Mobile; } }
protected void CancelButton_Click(object sender, EventArgs e) { TextBox NameTextBox = WebUserControl1.FindControl("NameTextBox") as TextBox; TextBox CityTextBox = WebUserControl1.FindControl("CityTextBox") as TextBox; NameTextBox.Text = null; CityTextBox.Text = null; AddressTextBox.Text = null; RegistrationTextBox.Text = null; }
protected void SaveClubButton_Click(object sender, EventArgs e) { Response.Write("<script>alert('CLUB SAVED SUCCESSFULLY') </script>"); AddPlayerButton.Visible = true; TextBox NameTextBox = WebUserControl1.FindControl("NameTextBox") as TextBox; TextBox CityTextBox = WebUserControl1.FindControl("CityTextBox") as TextBox; string ClubName = NameTextBox.Text; string ClubCity = CityTextBox.Text; SqlConnection conn; SqlCommand comm; // Read the connection string from Web.config string connectionString = ConfigurationManager.ConnectionStrings["SoccerLeague"].ConnectionString; // Initialize connection conn = new SqlConnection(connectionString); // Create command comm = new SqlCommand("insert into ClubTable(ClubName, ClubCity, ClubRegistrationNo , ClubAddress) values( @ClubName, @ClubCity, @RegistrationNumber, @Address)", conn); comm.Parameters.AddWithValue("@ClubName", ClubName); comm.Parameters.AddWithValue("@ClubCity", ClubCity); comm.Parameters.AddWithValue("@RegistrationNumber", RegistrationTextBox.Text); comm.Parameters.AddWithValue("@Address", AddressTextBox.Text); try { conn.Open(); comm.ExecuteNonQuery(); } catch (SqlException ex) { Label6.Visible = true; Label6.Text = ex.Message; } finally { conn.Close(); } }
private void CommanCallUserControl(DataSet ds, string reporttype) { GetConnectionStringSTRING obj = new GetConnectionStringSTRING(); connectionstring = obj.BAL_EpathshalaString(); try { WebUserControl1.ConnectionString = connectionstring; //reporttype = Server.MapPath("Files/MonthlySummary.xml"); WebUserControl1.XMLReportFile = Server.MapPath(reporttype); WebUserControl1.Search(ds.Tables[0]); //WebUserControl1.Search(); } catch (Exception ex) { WebMsg.Show("" + ex.Message.ToString()); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Request.QueryString["SourcePage"] != null) { Session["SourcePage"] = Request.QueryString["SourcePage"]; } int intSwitchID = int.Parse(Request.QueryString["SID"].ToString()); string strPortfolioID = Request.QueryString["PID"].ToString(); string strClientID = Request.QueryString["CID"].ToString(); this.ucCurrentPortfolio.propClientID = strClientID; this.ucCurrentPortfolio.propPortfolioID = strPortfolioID; this.ucCurrentPortfolio.propUserID = strClientID; this.ucHeader1.propClientID = strClientID; this.ucHeader1.propPortfolioID = strPortfolioID; this.ucHeader1.propUserID = strClientID; clsPortfolio Portfolio = new clsPortfolio(strClientID, strPortfolioID); foreach (clsHistory History in clsHistory.getListHistory(strPortfolioID, intSwitchID)) { switch (History.propStatus) { case 0: //draft break; case 1: //save break; case 2: //proposed WebUserControl1 ucProposed = (WebUserControl1)LoadControl("UserControl/ucSwitchDetails.ascx"); ucProposed.propSwitchDetails = clsHistory.getSwitchDetailsIFA(Portfolio, intSwitchID, History.propHistoryID); ucProposed.propStatus = History.propStatus; ucProposed.propDateAction = History.propAction_Date; ucProposed.propMessage = clsHistory.getMessage(History.propHistoryID); ucProposed.propTitle = "IFA Proposed Switch"; this.divHistoryHolder.Controls.Add(ucProposed); break; case 3: //amended WebUserControl1 ucAmended = (WebUserControl1)LoadControl("UserControl/ucSwitchDetails.ascx"); ucAmended.propSwitchDetails = clsHistory.getSwitchDetailsIFA(Portfolio, intSwitchID, History.propHistoryID); ucAmended.propStatus = History.propStatus; ucAmended.propDateAction = History.propAction_Date; ucAmended.propMessage = clsHistory.getMessage(History.propHistoryID); ucAmended.propTitle = "Client Proposed Switch"; this.divHistoryHolder.Controls.Add(ucAmended); break; case 4: //decline IFA break; case 5: //decline Client WebUserControl1 ucDeclinedClient = (WebUserControl1)LoadControl("UserControl/ucSwitchDetails.ascx"); ucDeclinedClient.propStatus = History.propStatus; ucDeclinedClient.propDateAction = History.propAction_Date; ucDeclinedClient.propMessage = clsHistory.getMessage(History.propHistoryID); ucDeclinedClient.propTitle = "Switch Declined"; this.divHistoryHolder.Controls.Add(ucDeclinedClient); break; case 6: //Approved WebUserControl1 ucApproved = (WebUserControl1)LoadControl("UserControl/ucSwitchDetails.ascx"); ucApproved.propStatus = History.propStatus; ucApproved.propDateAction = History.propAction_Date; ucApproved.propTitle = "Switch Approved"; this.divHistoryHolder.Controls.Add(ucApproved); break; case 7: //lock break; case 8: //request for discussion WebUserControl1 ucRequest = (WebUserControl1)LoadControl("UserControl/ucSwitchDetails.ascx"); ucRequest.propStatus = History.propStatus; ucRequest.propDateAction = History.propAction_Date; ucRequest.propMessage = clsHistory.getMessage(History.propHistoryID); ucRequest.propTitle = "Client Requested Contact"; this.divHistoryHolder.Controls.Add(ucRequest); break; case 9: //Cancelled break; case 10: //Completed WebUserControl1 ucCompleted = (WebUserControl1)LoadControl("UserControl/ucSwitchDetails.ascx"); ucCompleted.propStatus = History.propStatus; ucCompleted.propDateAction = History.propAction_Date; ucCompleted.propTitle = "Switch Completed"; this.divHistoryHolder.Controls.Add(ucCompleted); break; } } } }
public ASCXControlTest() { _control = new WebUserControl1(); }
public static string ProcessIT(string name, string address) { return(WebUserControl1.ProcessIT(name, address)); }