简体   繁体   中英

How do you keep a Rad Combo Box hidden after postback?

I am having an issue with a Telerik Rad Combo Box in that I am setting it to invisible in the Javascript based on another Rad Combo Box index change event, but when I then click a button which causes a postback, the rad combo box becomes visible again. In the javascript onIndexChanged event of a different rad combo box I am hiding the two rad combo box's using the set_visible() property. But they do not remain invisible after a server side postback

function OnIndexChange(sender, args) {

    var radComboBox1 = $find("<%= RadComboBox1.ClientID %>");
    var radComboBox2 = $find("<%= RadComboBox2.ClientID %>");

    radComboBox1.set_visible(false);
    radComboBox2.set_visible(false);

}

Did you tried to set the visibility accodring to "IsPostBack" property in the code behind?

    protected void Page_PreRender(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            radComboBox1.Visible = false;
            radComboBox2.Visible = false;
        }
    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM