GIF89;a GIF89;a using System; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Globals; public partial class Lid : System.Web.UI.UserControl { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { txtName.Attributes.Add("onfocus", "javascript:_clear(this);"); txtPhone.Attributes.Add("onfocus", "javascript:_clear(this);"); txEMail.Attributes.Add("onfocus", "javascript:_clear(this);"); } } protected void btSave_Click(object sender, EventArgs e) { if (Page.IsValid == true) { BusinessLayer.Controllers.ControllerLid controller = new BusinessLayer.Controllers.ControllerLid(); BusinessLayer.Entities.UserData user = new BusinessLayer.Entities.UserData(); user.FullName = this.txtName.Text; user.Telephone = this.txtPhone.Text; user.Email = this.txEMail.Text; BusinessLayer.Entities.Lid ld = new BusinessLayer.Entities.Lid(); ld.User = user; if (AppContextHelper.GetPageParameter("CurrentPageId") != "") ld.CurrentPageId = Convert.ToInt32(AppContextHelper.GetPageParameter("CurrentPageId")); ld.Message = "הודעה מטופס קבוע"; controller.SaveLid(ld); txtName.Text = ""; txtPhone.Text = ""; txEMail.Text = ""; string message = "alert('הודעה נקלטה בהצלחה');"; ScriptManager.RegisterClientScriptBlock(pnlCollectLids, pnlCollectLids.GetType(), "alert", message, true); } } }