当前位置: 首页>>代码示例>>C#>>正文


C# Panel.FindControl方法代码示例

本文整理汇总了C#中System.Web.UI.WebControls.Panel.FindControl方法的典型用法代码示例。如果您正苦于以下问题:C# Panel.FindControl方法的具体用法?C# Panel.FindControl怎么用?C# Panel.FindControl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Web.UI.WebControls.Panel的用法示例。


在下文中一共展示了Panel.FindControl方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LoadSettings

        private void LoadSettings()
        {
            AddClassToBody("registerpage");

            siteAvailableSubscriptions = NewsletterHelper.GetAvailableNewslettersForSiteMembers(siteSettings.SiteGuid);

            IncludeDescriptionInList = displaySettings.IncludeNewsletterDescriptionInList;
            pnlSubscribe = (Panel)CreateUserWizardStep1.ContentTemplateContainer.FindControl("pnlSubscribe");
            if (pnlSubscribe != null)
            {
                pnlSubscribe.Visible = displaySettings.ShowNewsLetters;

                clNewsletters = (CheckBoxList)pnlSubscribe.FindControl("clNewsletters");
                rbHtmlFormat = (RadioButton)pnlSubscribe.FindControl("rbHtmlFormat");
                rbPlainText = (RadioButton)pnlSubscribe.FindControl("rbPlainText");

                rbHtmlFormat.Text = Resource.NewsletterHtmlFormatLabel;
                rbPlainText.Text = Resource.NewsletterPlainTextFormatLabel;
                Label lblNewsletterListHeading = (Label)pnlSubscribe.FindControl("lblNewsletterListHeading");
                lblNewsletterListHeading.Text = displaySettings.NewsletterListHeading.Coalesce(Resource.NewsletterPreferencesHeader);
                // fix bug https://www.mojoportal.com/Forums/Thread.aspx?pageid=5&t=11390~1#post47409
                if((IsPostBack)&&(clNewsletters.Items.Count == 0)) { pnlSubscribe.Visible = false;}
            }

            if (WebConfigSettings.AllowUserProfilePage)
            {
                string destinationUrl = WebConfigSettings.PageToRedirectToAfterRegistration;
                if (destinationUrl.Length == 0) { destinationUrl = "/Secure/UserProfile.aspx"; }

                this.RegisterUser.FinishDestinationPageUrl
                    = SiteRoot + destinationUrl;

                this.RegisterUser.ContinueDestinationPageUrl
                    = SiteRoot + destinationUrl;

                this.RegisterUser.EditProfileUrl = SiteRoot + "/Secure/UserProfile.aspx";
            }
            else
            {
                this.RegisterUser.FinishDestinationPageUrl = SiteRoot ;

                this.RegisterUser.ContinueDestinationPageUrl = SiteRoot;

                this.RegisterUser.EditProfileUrl = SiteRoot;

            }

            rpxApiKey = siteSettings.RpxNowApiKey;
            rpxApplicationName = siteSettings.RpxNowApplicationName;

            if (WebConfigSettings.UseOpenIdRpxSettingsFromWebConfig)
            {
                if (WebConfigSettings.OpenIdRpxApiKey.Length > 0)
                {
                    rpxApiKey = WebConfigSettings.OpenIdRpxApiKey;
                }

                if (WebConfigSettings.OpenIdRpxApplicationName.Length > 0)
                {
                    rpxApplicationName = WebConfigSettings.OpenIdRpxApplicationName;
                }

            }

            //string returnUrlParam = Page.Request.Params.Get("returnurl");
            //if (!String.IsNullOrEmpty(returnUrlParam))
            //{
            //    string redirectUrl = Page.ResolveUrl(Page.Server.UrlDecode(returnUrlParam));
            //    this.RegisterUser.FinishDestinationPageUrl = redirectUrl;
            //    this.RegisterUser.ContinueDestinationPageUrl = redirectUrl;

            //}

            if (ViewState["returnurl"] != null)
            {
                this.RegisterUser.ContinueDestinationPageUrl = ViewState["returnurl"].ToString();
            }

            // only allow return urls that are relative or start with the site root
            //http://www.mojoportal.com/Forums/Thread.aspx?thread=5314&mid=34&pageid=5&ItemID=2&pagenumber=1#post22121

            if (Request.Params.Get("returnurl") != null)
            {
                //string returnUrlParam = Page.Request.Params.Get("returnurl");
                //if (!String.IsNullOrEmpty(returnUrlParam))
                //{
                    //returnUrlParam = SecurityHelper.RemoveMarkup(returnUrlParam);
                string redirectUrl = SiteUtils.GetReturnUrlParam(Page, SiteRoot);
                    //string redirectUrl = Page.ResolveUrl(SecurityHelper.RemoveMarkup(Page.Server.UrlDecode(returnUrlParam)));
                    //if (redirectUrl.StartsWith("/")) { redirectUrl = SiteRoot + redirectUrl; }

                    //if (
                    //    (redirectUrl.StartsWith(SiteRoot))
                    //    || (redirectUrl.StartsWith(SiteRoot.Replace("https://", "http://")))
                    //    )
                    //{
                if (redirectUrl.Length > 0)
                {
                    this.RegisterUser.ContinueDestinationPageUrl = redirectUrl;
                }
//.........这里部分代码省略.........
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:101,代码来源:Register.aspx.cs

示例2: SetPhotoCategories

        /// <summary>
        /// Set the photo categories
        /// </summary>
        /// <param name="imagePanel">The panel that contains the photo</param>
        /// <returns></returns>
        private async Task SetPhotoCategories(Panel imagePanel)
        {
            Image itemImage = (Image)imagePanel.FindControl("itemImage");
            Image itemLoading = (Image)imagePanel.FindControl("itemWordsLoading");
            Label itemWords = (Label)imagePanel.FindControl("itemWords");

            itemLoading.Visible = false;

            var item = ItemList.Where(i => i.URL.Equals(itemImage.ImageUrl)).FirstOrDefault();

            if (item != null && string.IsNullOrEmpty(item.Words))
            {
                string[] tags = await ComputerVision.GetCategories(item.URL);
                item.Words = StringUtils.ConvertStringArrayToString(tags);
                itemWords.Text = item.Words;
            }

            if (item == null || String.IsNullOrEmpty(item.Words))
            {
                itemWords.Text = "Não foi possível obter as categorias da imagem";
            }
        }
开发者ID:ConjectoBI,项目名称:AzureSolutionlets,代码行数:27,代码来源:Default.aspx.cs

示例3: SaveProperty

        public static void SaveProperty(
            SiteUser siteUser,
            Panel parentControl,
            mojoProfilePropertyDefinition propertyDefinition,
            Double legacyTimeZoneOffset,
            TimeZoneInfo timeZone)
        {
            String controlID;
            Control control;

            if (propertyDefinition.ISettingControlSrc.Length > 0)
            {
                controlID = "isc" + propertyDefinition.Name;
                control = parentControl.FindControl(controlID);
                if (control != null)
                {
                    siteUser.SetProperty(
                        propertyDefinition.Name,
                        ((ISettingControl)control).GetValue(),
                        propertyDefinition.SerializeAs,
                        propertyDefinition.LazyLoad);
                }

            }
            else
            {

                switch (propertyDefinition.Type)
                {
                    case "System.Boolean":

                        controlID = "chk" + propertyDefinition.Name;
                        control = parentControl.FindControl(controlID);
                        if (control != null)
                        {
                            siteUser.SetProperty(
                                propertyDefinition.Name,
                                ((CheckBox)control).Checked,
                                propertyDefinition.SerializeAs,
                                propertyDefinition.LazyLoad);

                        }

                        break;

                    case "System.DateTime":

                        controlID = "dp" + propertyDefinition.Name;
                        control = parentControl.FindControl(controlID);
                        if (control != null)
                        {
                            DatePickerControl dp = (DatePickerControl)control;
                            if (dp.Text.Length > 0)
                            {
                                DateTime dt;
                                if (DateTime.TryParse(
                                    dp.Text,
                                    CultureInfo.CurrentCulture,
                                    DateTimeStyles.AdjustToUniversal, out dt))
                                {

                                    if (propertyDefinition.IncludeTimeForDate)
                                    {
                                        if (timeZone != null)
                                        {
                                            dt = dt.ToUtc(timeZone);
                                        }
                                        else
                                        {
                                            dt = dt.AddHours(-legacyTimeZoneOffset);
                                        }

                                        if (propertyDefinition.Name == "DateOfBirth")
                                        {
                                            siteUser.DateOfBirth = dt.Date;
                                            siteUser.Save();
                                        }
                                        else
                                        {
                                            siteUser.SetProperty(
                                                propertyDefinition.Name,
                                                dt.ToString(),
                                                propertyDefinition.SerializeAs,
                                                propertyDefinition.LazyLoad);
                                        }
                                    }
                                    else
                                    {

                                        if(propertyDefinition.Name == "DateOfBirth")
                                        {
                                            siteUser.DateOfBirth = dt.Date;
                                            siteUser.Save();
                                        }
                                        else
                                        {
                                            siteUser.SetProperty(
                                            propertyDefinition.Name,
                                            dt.Date.ToShortDateString(),
                                            propertyDefinition.SerializeAs,
//.........这里部分代码省略.........
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:101,代码来源:mojoProfilePropertyDefinition.cs

示例4: DisplayNeueZutatentenListe

        /// <summary>
        /// Displays an empty Zutetenlist which is used when new Zutaten are added.
        /// </summary>
        /// <param name="rezeptAbteilungPanel"></param>
        /// <param name="newestOnly">true when called form the AddZutaten OnClick event</param>
        private void DisplayNeueZutatentenListe(Panel rezeptAbteilungPanel, bool newestOnly)
        {
            var eventtarget = Request.Params.Get("__EVENTTARGET"); //is null when a submit button is clicked or page is loaded without postback
            var rezeptAbteilungPanelID = Helper.IsolateRezepAbteilungPanelIDFromEventtargetString(eventtarget);

            var zutatenAnzahl = 0;
            if (ViewState[rezeptAbteilungPanel.ID] != null)
                zutatenAnzahl = (int) ViewState[rezeptAbteilungPanel.ID];

            if(zutatenAnzahl == 0)
            {
                //ZutatenCounter für Rezeptabteilung erhöhen
                zutatenAnzahl += 1;
                ViewState[rezeptAbteilungPanel.ID] = zutatenAnzahl;
            }

            if (newestOnly)
            {
                //Bestehende neue Zutat und Rezeptabteilung Buttons entfernen - sonst steht die neue Zeile nach den Buttons
                var neueZutatButton = rezeptAbteilungPanel.FindControl(Helper.REZEPBEARBEITEN_IDENT_NEUE_ZUTAT_BUTTON + rezeptAbteilungPanel.ID);
                var neueRezeptAbteilungButton = rezeptAbteilungPanel.FindControl(Helper.REZEPBEARBEITEN_IDENT_NEUE_REZEPTABTEILUNG_BUTTON + rezeptAbteilungPanel.ID);
                var neueZutatButtonLit = rezeptAbteilungPanel.FindControl("Lit " + Helper.REZEPBEARBEITEN_IDENT_NEUE_REZEPTABTEILUNG_BUTTON + rezeptAbteilungPanel.ID);
                rezeptAbteilungPanel.Controls.Remove(neueZutatButton);
                rezeptAbteilungPanel.Controls.Remove(neueRezeptAbteilungButton);
                rezeptAbteilungPanel.Controls.Remove(neueZutatButtonLit);

                //Neue Zutatenliste Eingaben einfügen inkl. leeren Eintrag
                this.DisplayNeueZutatenListeEingaben(rezeptAbteilungPanel, zutatenAnzahl-1);
                this.DisplayNeueZutatButton(rezeptAbteilungPanel);
                rezeptAbteilungPanel.Controls.Add(new Literal { Text = "&nbsp;" });
                DisplayNeueRezeptabteilungButton(rezeptAbteilungPanel);
            }
            else
            {
                for (int i = 0; i < zutatenAnzahl; i++)
                {
                    //Neue Zutatenliste Eingaben einfügen inkl. leeren Eintrag
                    this.DisplayNeueZutatenListeEingaben(rezeptAbteilungPanel, i);

                    //Der leeren Eintrag erhält den neue Zutat Button und den neuen Rezeptabteilung Button
                    if (i == zutatenAnzahl - 1)
                    {
                        this.DisplayNeueZutatButton(rezeptAbteilungPanel);
                        rezeptAbteilungPanel.Controls.Add(new Literal { Text = "&nbsp;", ID = "Lit " + Helper.REZEPBEARBEITEN_IDENT_NEUE_REZEPTABTEILUNG_BUTTON + rezeptAbteilungPanel.ID });
                        DisplayNeueRezeptabteilungButton(rezeptAbteilungPanel);
                    }
                }
            }
        }
开发者ID:rgherzog,项目名称:RezeptVerwaltung,代码行数:54,代码来源:RezeptBearbeiten.aspx.cs

示例5: getCbxResult

        private String getCbxResult(Panel pnlID, String cbxID)
        {
            CheckBox tempCbx = pnlID.FindControl(cbxID) as CheckBox;

            if (tempCbx != null)
            {
                return tempCbx.Checked.ToString();
            }
            else
            {
                return null;
            }
        }
开发者ID:Sryn,项目名称:Movie6,代码行数:13,代码来源:genChkBoxTest.aspx.cs

示例6: LoadState

        public static void LoadState(
            Panel parentControl,
            mojoProfilePropertyDefinition propertyDefinition)
        {
            String controlID;
            Control control;

            switch (propertyDefinition.Type)
            {
                case "System.Boolean":

                    controlID = "chk" + propertyDefinition.Name;
                    control = parentControl.FindControl(controlID);
                    if (control != null)
                    {
                        propertyDefinition.StateValue = ((CheckBox)control).Checked.ToString();

                    }

                    break;

                case "System.DateTime":

                    controlID = "dp" + propertyDefinition.Name;
                    control = parentControl.FindControl(controlID);
                    if (control != null)
                    {
                        DatePickerControl dp = (DatePickerControl)control;
                        if (dp.Text.Length > 0)
                        {
                            propertyDefinition.StateValue = dp.Text;

                        }
                    }

                    break;

                case "System.String":
                default:

                    if (propertyDefinition.OptionList.Count > 0)
                    {
                        if (propertyDefinition.Type == "CheckboxList")
                        {
                            controlID = "cbl" + propertyDefinition.Name;
                            control = parentControl.FindControl(controlID);
                            if (control != null)
                            {
                                if (control is CheckBoxList)
                                {
                                    CheckBoxList cbl = (CheckBoxList)control;
                                    propertyDefinition.StateValue = cbl.Items.SelectedItemsToCommaSeparatedString();

                                }
                            }

                        }
                        else
                        {
                            controlID = "dd" + propertyDefinition.Name;
                            control = parentControl.FindControl(controlID);
                            if (control != null)
                            {
                                if (control is DropDownList)
                                {
                                    DropDownList dd = (DropDownList)control;
                                    if (dd.SelectedIndex > -1)
                                    {
                                        propertyDefinition.StateValue = dd.SelectedValue;

                                    }
                                }
                            }
                        }

                    }
                    else
                    {
                        controlID = "txt" + propertyDefinition.Name;
                        control = parentControl.FindControl(controlID);
                        if (control != null)
                        {
                            propertyDefinition.StateValue = ((TextBox)control).Text;

                        }

                    }

                    break;

            }
        }
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:92,代码来源:mojoProfilePropertyDefinition.cs

示例7: getCbxResult

        private String getCbxResult(Panel pnlID, String cbxID)
        {
            System.Diagnostics.Debug.WriteLine(">> In getCbxResult(" + pnlID.ID + ", " + cbxID + ")");

            CheckBox tempCbx = pnlID.FindControl(cbxID) as CheckBox;

            if (tempCbx != null)
            {
                return tempCbx.Checked.ToString();
            }
            else
            {
                return null;
            }
        }
开发者ID:Sryn,项目名称:Movie6,代码行数:15,代码来源:genChkBoxTest_wMstrPage.aspx.cs

示例8: getTbx

        private TextBox getTbx(Panel pnlID, string tbxID)
        {
            //            throw new NotImplementedException();

            TextBox tempTbx = pnlID.FindControl(tbxID) as TextBox;

            if (tempTbx != null)
            {
                return tempTbx;
            }
            else
            {
                return null;
            }
        }
开发者ID:Sryn,项目名称:Movie6,代码行数:15,代码来源:genChkBoxTest.aspx.cs

示例9: processBtnUpdateCbxs

        private void processBtnUpdateCbxs(Panel pnlID, string numOfCbxsTbxID, String cbxPrefix, string outTbxID)
        {
            System.Diagnostics.Debug.WriteLine(">> In processBtnUpdateCbxs(..)");

            int numOfCbxs, i;
            String myStringVariable = string.Empty;
            TextBox numOfCbxsTbx = getTbx(pnlID, numOfCbxsTbxID);
            TextBox outTbx = getTbx(pnlID, outTbxID);
            CheckBox cbx;

            if (numOfCbxsTbx != null && outTbx != null)
            {
                numOfCbxs = getIntFrom(pnlID, numOfCbxsTbxID);

                if (numOfCbxs > 0)
                {
                    outTbx.Text = "";

                    for (i = 1; i <= numOfCbxs; i++)
                    {
                        cbx = pnlID.FindControl(cbxPrefix + i.ToString()) as CheckBox;

                        if (cbx != null)
                        {
                            outTbx.Text += ", " + cbx.ID + "=" + cbx.Checked.ToString();
                        }
                    }
                }
            }
            else
            {
                if (numOfCbxsTbx == null)
                    myStringVariable = numOfCbxsTbxID;

                if (outTbx == null)
                    myStringVariable = myStringVariable + " " + outTbxID ;

                myStringVariable = myStringVariable + " cannot be found";

//                ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable + "');", true);
                doAlert(myStringVariable);
            }
        }
开发者ID:Sryn,项目名称:Movie6,代码行数:43,代码来源:genChkBoxTest_wMstrPage.aspx.cs

示例10: getTbx

        private TextBox getTbx(Panel pnlID, string tbxID)
        {
            //            throw new NotImplementedException();
            System.Diagnostics.Debug.WriteLine(">> In getTbx(" + pnlID.ID + ", " + tbxID + ")");

            TextBox tempTbx = pnlID.FindControl(tbxID) as TextBox;

            if (tempTbx != null)
            {
                return tempTbx;
            }
            else
            {
                return null;
            }
        }
开发者ID:Sryn,项目名称:Movie6,代码行数:16,代码来源:genChkBoxTest_wMstrPage.aspx.cs

示例11: getIntFrom

        private int getIntFrom(Panel pnlID, string tbxID)
        {
//            throw new NotImplementedException();
            System.Diagnostics.Debug.WriteLine(">> In getIntFrom(" + pnlID.ID + ", " + tbxID + ")");

            TextBox tempTbx = pnlID.FindControl(tbxID) as TextBox;

            if (tempTbx != null)
            {
                int result;

                if (int.TryParse(tempTbx.Text, out result))
                {
                    return result;
                }
                else
                {
                    return 0;
                }
            }
            else
            {
                return 0;
            }
        }
开发者ID:Sryn,项目名称:Movie6,代码行数:25,代码来源:genChkBoxTest_wMstrPage.aspx.cs

示例12: SeguridadInspeccion

 /// <summary>
 /// Determina la visualización de las opciones disponibles para el usuario
 /// </summary>
 /// <param name="uid">Identificacion del usuario</param>
 /// <param name="controlPanel">Panel donde se ubican los controles a determinar su presentacion</param>
 public static void SeguridadInspeccion(Object uid, Panel controlPanel)
 {
     if (uid != null)
       {
     int uidValue = int.Parse((string)uid);
     if (uidValue == 1)
     {
       ((ImageButton)controlPanel.FindControl("anularImageButton")).Visible = false;
       ((ImageButton)controlPanel.FindControl("aprobarImageButton")).Visible = false;
       ((ImageButton)controlPanel.FindControl("desaprobarImageButton")).Visible = false;
       ((ImageButton)controlPanel.FindControl("terminarImageButton")).Visible = true;
     }
     else if (uidValue == 2)
     {
       controlPanel.Visible = false;
     }
       }
 }
开发者ID:royriojas,项目名称:Clave-Projects,代码行数:23,代码来源:GestorInspeccion.cs

示例13: CheckEmptySearch

        protected bool CheckEmptySearch(Panel panel)
        {
            bool searchOnCommission = true;
            bool searchOnPremiere = true;//string.IsNullOrEmpty(premiereControl.SelectedValue.Trim());

            var commissionControl = (DropDownList)panel.FindControl("WorkCommissions");
            if (commissionControl != null) searchOnCommission = string.IsNullOrEmpty(commissionControl.SelectedValue.Trim());

            var premiereControl = (DropDownList)panel.FindControl("WorkPremiere");
            if (premiereControl != null) searchOnPremiere = string.IsNullOrEmpty(premiereControl.SelectedValue.Trim());

            return panel.Controls.OfType<TextBox>().All(input => String.IsNullOrEmpty(input.Text.Trim())) && searchOnCommission && searchOnPremiere;
        }
开发者ID:BostonSymphOrch,项目名称:HENRY-archives,代码行数:13,代码来源:BaseUserControl.cs

示例14: SetDataToControlsOnPanel

        public static void SetDataToControlsOnPanel(Panel oPanel, DataTable oDT, int eFormID)
        {
            foreach (System.Web.UI.Control oControl in oPanel.Controls)
            {
                for (int n = 0; n <= oDT.Columns.Count - 1; n++)
                {
                    string ColumnName = oDT.Columns[n].ColumnName;
                    Control oWControl = oPanel.FindControl("txtEform" + ColumnName) as Control;
                    if (oWControl != null)
                    {
                        TextBox oText = oWControl as TextBox;
                        oText.Text = oDT.Rows[0][ColumnName].ToString();
                    }
                    Control oOtherControl = oPanel.FindControl(ColumnName) as Control;
                    if (oOtherControl != null)
                    {

                        if (oOtherControl is TextBox)
                        {
                            TextBox oText = oOtherControl as TextBox;
                            oText.Text = oDT.Rows[0][ColumnName].ToString();
                        }
                        else if (oOtherControl is DropDownList)
                        {
                            DropDownList oDDL = oOtherControl as DropDownList;
                            oDDL.SelectedValue = oDT.Rows[0][ColumnName].ToString();
                        }
                        else if (oOtherControl is CheckBox)
                        {
                            CheckBox oChk = oOtherControl as CheckBox;
                            if (oDT.Rows[0][ColumnName].ToString() != string.Empty)
                            {
                                if (Convert.ToBoolean(oDT.Rows[0][ColumnName]) == false)
                                {
                                    oChk.Checked = false;
                                }
                                else
                                {
                                    oChk.Checked = true;
                                }
                            }
                        }
                        else if (oOtherControl is UserControl)
                        {

                            if (oDT.Rows[0][ColumnName] != null)
                            {

                                if (oDT.Rows[0][ColumnName].ToString() != string.Empty)
                                {
                                    if (HttpContext.Current.Session[ImageList] == null)
                                    {
                                        Hashtable oImageValue = new Hashtable();
                                        oImageValue.Add(oOtherControl.ClientID, oDT.Rows[0][ColumnName].ToString());
                                        HttpContext.Current.Session[ImageList] = oImageValue;
                                        HttpContext.Current.Session[FormDesign.SessionImageList] = oImageValue;
                                        ucImageControl oImage = oOtherControl as ucImageControl;

                                        oImage.SetImagePath();

                                    }
                                    else
                                    {
                                        if (oDT.Rows[0][ColumnName] != null)
                                        {
                                            Hashtable oImageValue = HttpContext.Current.Session[ImageList] as Hashtable;
                                            if (!oImageValue.ContainsKey(oOtherControl.ClientID))
                                            {

                                                oImageValue.Add(oOtherControl.ClientID, oDT.Rows[0][ColumnName].ToString());
                                                HttpContext.Current.Session[ImageList] = oImageValue;
                                                HttpContext.Current.Session[FormDesign.SessionImageList] = oImageValue;
                                                ucImageControl oImage = oOtherControl as ucImageControl;
                                                oImage.SetImagePath();

                                            }

                                        }

                                    }

                                }

                            }

                        }

                    }
                }

            }
        }
开发者ID:traveler33,项目名称:Class,代码行数:92,代码来源:FormDesign.cs

示例15: GetText

 public string GetText(Panel pn)
 {
     string strQueryText = "";
     for (int i = 0; i < this.Columns.Count; i++)
     {
         string text = "";
         //if (pn.FindControl("txt" + i.ToString()) == null)
         //{
         //    return "GetText Error!Can't find control in panel: " + pn.ID;
         //}
         switch (((WebQueryColumns)this.Columns[i]).ColumnType)
         {
             case "ClientQueryTextBoxColumn":
                 text = (pn.FindControl("txt" + i.ToString()) as TextBox).Text;
                 break;
             case "ClientQueryComboBoxColumn":
                 text = (pn.FindControl("txt" + i.ToString()) as WebDropDownList).SelectedValue;
                 break;
             case "ClientQueryRefValColumn":
                 text = (pn.FindControl("txt" + i.ToString()) as WebRefVal).BindingValue;
                 break;
             case "ClientQueryCalendarColumn":
                 text = (pn.FindControl("txt" + i.ToString()) as WebDateTimePicker).Text;
                 break;
         }
         if (text != string.Empty)
         {
             strQueryText += ((WebQueryColumns)this.Columns[i]).Caption
                                + ((WebQueryColumns)this.Columns[i]).Operator
                                + text + "\n";
         }
     }
     return strQueryText;
 }
开发者ID:san90279,项目名称:UK_OAS,代码行数:34,代码来源:WebClientQuery.cs


注:本文中的System.Web.UI.WebControls.Panel.FindControl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。