Can anybody tell me how to popup new window in SelectIndexChanged function?

3 posts, 0 answers
  1. Simon Durant
    Simon Durant avatar
    5 posts
    Member since:
    Jan 2007

    Posted 08 Dec 2009 Link to this post

    Hi guys,

    I got a problem regarding user chooses a specified option in combobox, poping up a new window for user.

    the aspx code just put a telerik radcombobox on the web page and set SelectIndexChanged event
    backend code are:

     protected void ddlClient1_SelectedIndexChanged(object sender, EventArgs e)
          {
             if (ddlClient1.SelectedValue.Equals("-1"))
                {
                string script = "alert('aabb')";

                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), ((Telerik.Web.UI.RadComboBox)sender).ClientID, script, true);
             }
          }

    but it doesn't work.

    Thanks

    Alex
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 08 Dec 2009 Link to this post

    Hello Simon,

    You can open the window from code behind as shown below.

    CS:
     
        protected void RadComboBox5_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) 
        { 
            if (RadComboBox5.SelectedValue.Equals("-1")) 
            { 
                RadWindow newWindow = new RadWindow(); 
                newWindow.NavigateUrl = "http://www.google.com"
                newWindow.VisibleOnPageLoad = true// Set the VisibleOnPageLoad to true 
                this.form1.Controls.Add(newWindow); 
            } 
        } 

    -Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Simon Durant
    Simon Durant avatar
    5 posts
    Member since:
    Jan 2007

    Posted 08 Dec 2009 Link to this post

    Hi Shinu,

    Thanks for your reply.
    It did work after I remove the updatepanel!

    cheers for your help

    All the best to you

    Alex
Back to Top