protected void ddlAnnouncementTo_SelectedIndexChanged(object sender, EventArgs e) { try { if (ddlAnnouncementTo.SelectedIndex != 0) { SqlDataReader sdr = uc.GetUserMobile(ddlAnnouncementTo.SelectedItem.Text, ddlAnnouncementTo.SelectedItem.Value); if (sdr.HasRows) { if (sdr.Read()) { txtAnnouncementToMobile.Text = sdr["t_MobileNo"].ToString(); } } sdr.Close(); } } catch (Exception ex) { string exrmsg = ex.Message.ToString(); ScriptManager.RegisterStartupScript(this, typeof(Page), "Warning", "<script>showpoperror('" + exrmsg + "')</script>", false); } }