protected void Page_Load(object sender, EventArgs e){ if (!IsPostBack && Request.Form["MethodName"] == "SendReply") { var a = Request.Form["Reply"].ToString(); SendReply(a); } if (!IsPostBack && Request.Form.Count ==0 ) { if (Request.QueryString["productId"] != null) { //other unrequired code removed for sake of easiness hdn.Value = Membership.GetUser(info.Mail).UserName; //Session["usr"] = Membership.GetUser(info.Mail).UserName; } } } else if(IsPostBack) { } } private void SendReply(string a) { try { string username = Membership.GetUser().ToString(); if (username!=null) { //this condition is not running because im getting hdn.value="" if (hdn.Value!=null || hdn.Value!="" ) { var aa = (string)Session["ownerid"]; Session.Remove("ownerid"); } } } catch (Exception) { } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)