Hi,
I have a dropdownlist in side a gridview, Onselectedindexchanged I want to some action. But it doing postback but I don't want postback.Can any one helpme out in stoping the PostBack.I also used Updatepanel but after that the action what I want its not happening.
Below is my code for .cs
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (this.UserContext.UserRoles.Length == 0)
{
Response.Redirect("./Default.aspx");
}
if (!IsUserInRole(Constants.RL_GETSSET))
{
Response.Redirect("./Default.aspx");
}
adminBO = new UpdateAdminBO(this.UserContext);
btnRemove.Visible = false;
listSupportRoles = new DomainByCodeValue(this.UserContext, CategotyCode.SUPPORT_ROLES).DomainCodeValue;
listClarifyRegions = new DomainByCodeValue(this.UserContext, CategotyCode.CLARIFY_REGION).DomainCodeValue;
ViewState["listClarifyRegions"] = listClarifyRegions;
existingUserDetails = adminBO.GetUserDetails();
if (!IsPostBack)
{
ddlUserRoleSelect.DataSource = listSupportRoles;
ddlUserRoleSelect.DataTextField = "CodeValue";
ddlUserRoleSelect.DataValueField = "CodeID";
ddlUserRoleSelect.DataBind();
ddlUserRoleSelect.Items.Insert(0, new ListItem("ALL", "1"));
this.BindData();
ddlAddUser.DataSource = listSupportRoles;
ddlAddUser.DataTextField = "CodeValue";
ddlAddUser.DataValueField = "CodeID";
ddlAddUser.DataBind();
ddlAddUser.Items.Insert(0, new ListItem("Select User Role", "1"));
rcbRegions.DataSource = ViewState["listClarifyRegions"];
rcbRegions.DataTextField = "CodeValue";
rcbRegions.DataValueField = "CodeID";
rcbRegions.DataBind();
ddlUserRole.DataSource = listSupportRoles;
ddlUserRole.DataTextField = "CodeValue";
ddlUserRole.DataValueField = "CodeID";
ddlUserRole.DataBind();
ddlUserRole.Items.Insert(0, new ListItem("ALL", "1"));
if (Request.QueryString["id"] != null)
{
ScriptManager scriptManager = ScriptManager.GetCurrent(Page);
ScriptManager.RegisterClientScriptBlock(BtnUpdate, Page.GetType(), "MsgType_Info", "doShowMsg(\"New User Updated successfully.\", MsgType_Info)", true);
}
}
}
}
protected void ddlUserRole_SelectedIndexChanged(object sender, EventArgs e)
{
DropDownList ddlRole = (DropDownList)sender;
GridViewRow row = (GridViewRow)ddlRole.NamingContainer;
Telerik.Web.UI.RadComboBox rcbSecondaryUserRole = row.FindControl("rcbSecondaryUserRole") as RadComboBox;
if (ddlRole.SelectedItem.Text == "GSPO")
{
rcbSecondaryUserRole.DataSource = ViewState["listClarifyRegions"];
rcbSecondaryUserRole.DataTextField = "CodeValue";
rcbSecondaryUserRole.DataValueField = "CodeID";
rcbSecondaryUserRole.DataBind();
rcbSecondaryUserRole.Visible = true;
}
else
{
rcbSecondaryUserRole.Visible = false;
}
}