protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //MembershipUser CurrentUser = Membership.GetUser(); //Guid UserId = (Guid)CurrentUser.ProviderUserKey; DataTable dt = MessageBLL.GetAllUsers(); ddl_users.DataSource = dt; ddl_users.DataTextField = "UserName"; ddl_users.DataValueField = "UserId"; ddl_users.DataBind(); if (Request.QueryString["messaging"] != null) { Guid otherId = new Guid(Request.QueryString["messaging"]); MembershipUser CurrentUser = Membership.GetUser(); Guid UserId = (Guid)CurrentUser.ProviderUserKey; DataTable dtt = MessageBLL.GetAllMsgBw(UserId, otherId); gv_message.DataSource = dtt; gv_message.DataBind(); } } }