Iron Speed Technical Forums
Sign up Latest Topics

  Author   Comment  

Posts: 56
Reply with quote  #1 
        I have dropdown filter called ProjectName. In Project name filter there are many project names. There is also value called "create new" . My requirement is if user does not find his project then he will select or click  create new and then modal popup screen should appear to create that new project.

How to  achieve that  by in Ironspeed designer?

Avatar / Picture

MVP Developer
Posts: 1,970
Reply with quote  #2 
Yes, it's achievable. You just need to override the SelectedIndexChanged and call the generic NewPopUpModalWindow() method below when SelectedItem.Text = "create new":  

       public void NewPopUpModalWindow()
        //Note: You must replace TableName with the actual one as well as the DFKA_ColumnName and pK_ColumnName with actual names
        string url = @"../TableName/Add-TableName.aspx?TabVisible=False&SaveAndNewVisible=False";
        bool shouldRedirect = true;
        string target = null;
        if (target == null) target = ""; // avoid warning on VS
            try {
                // Enclose all database retrieval/update code within a Transaction boundary
                url = this.ModifyRedirectUrl(url, "",true);
                url = this.Page.ModifyRedirectUrl(url, "",true);
            } catch (Exception ex) {
                  // Upon error, rollback the transaction
                  shouldRedirect = false;
                  this.Page.ErrorOnPage = true;

            // Report the error message to the end user
            BaseClasses.Utils.MiscUtils.RegisterJScriptAlert(this, "BUTTON_CLICK_MESSAGE", ex.Message);
            } finally {
            if (shouldRedirect) {
                this.Page.ShouldSaveControlsToSession = true;
                    url = url + "&RedirectStyle=" + (this.Page as BaseApplicationPage).Encrypt("Popup") + "&Target=" + (this.Page as BaseApplicationPage).Encrypt(this.TableName.ClientID) + "&DFKA=" + (this.Page as BaseApplicationPage).Encrypt("DFKA_ColumnName")+ "&IndexField=" + (this.Page as BaseApplicationPage).Encrypt("pK_ColumnName");                      
                string javascriptCall = "";
                    javascriptCall = "initializePopupPage(this, '" + url + "', false, event);";                                      
                AjaxControlToolkit.ToolkitScriptManager.RegisterStartupScript(this, this.GetType(), "NewPopUpModalWindow", javascriptCall, true);


  Jaime Jegonia

Iron Speed MVP Developer

". . . and whoever sows generously will also reap generously" 2 Cor 9:6

Previous Topic | Next Topic

Quick Navigation:

Easily create a Forum Website with Website Toolbox.

Download Iron Speed Designer

Terms of Service Privacy Statement