This is a migrated thread and some comments may be shown as answers.

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

2 Answers 38 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Simon Durant
Top achievements
Rank 1
Simon Durant asked on 08 Dec 2009, 06:26 AM
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 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 08 Dec 2009, 07:49 AM
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.
0
Simon Durant
Top achievements
Rank 1
answered on 08 Dec 2009, 11:14 PM
Hi Shinu,

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

cheers for your help

All the best to you

Alex
Tags
ComboBox
Asked by
Simon Durant
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Simon Durant
Top achievements
Rank 1
Share this question
or