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


C# FormView.FindControl方法代码示例

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


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

示例1: GetDdlValue

 public int GetDdlValue(FormView fv, string name)
 {
     var ddl = fv.FindControl(name) as DropDownList;
     if (ddl.SelectedValue != null)
         return Convert.ToInt32(ddl.SelectedValue);
     return -1;
 }
开发者ID:pasha369,项目名称:RestaurantManagementSystem,代码行数:7,代码来源:Users.aspx.cs

示例2: BindControl

 /// <summary>
 /// Binds a controls value to a property of an entity.
 /// </summary>
 /// <param name="formView">A <see cref="FormView"/> object.</param>
 /// <param name="list">The <see cref="IOrderedDictionary"/> containing the values.</param>
 /// <param name="propertyName">The name of the property to bind the value to.</param>
 /// <param name="controlId">The id of the control to get the value from.</param>
 public static void BindControl(FormView formView, IOrderedDictionary list, string propertyName, string controlId)
 {
     if (formView != null)
      {
     Control control = formView.FindControl(controlId);
     BindControl(control, list, propertyName);
      }
 }
开发者ID:mario-loza,项目名称:School,代码行数:15,代码来源:FormUtilBase.generated.cs

示例3: extractTextBoxValue

 protected string extractTextBoxValue(FormView fv,string controlID)
 {
     try
     {
         return (fv.FindControl(controlID) as TextBox).Text;
     }
     catch (NullReferenceException ex)
     {
         return null;
     }
 }
开发者ID:RoykoSerhiy,项目名称:visualStudio_projects,代码行数:11,代码来源:MPage.cs

示例4: LoadUITestDataFromFormView

        public static void LoadUITestDataFromFormView(FormView formViewEmployee)
        {
            TextBox txtFirstName = (TextBox)formViewEmployee.FindControl("txtFirstName");
            TextBox txtLastName = (TextBox)formViewEmployee.FindControl("txtLastName");
            TextBox txtHireDate = (TextBox)formViewEmployee.FindControl("txtHireDate");
            TextBox txtAddress = (TextBox)formViewEmployee.FindControl("txtAddress");
            TextBox txtHomePhone = (TextBox)formViewEmployee.FindControl("txtHomePhone");
            DropDownList ddlCountry = (DropDownList)formViewEmployee.FindControl("ddlCountry");

            //since in read-only mode there is no text box control
            if (formViewEmployee.CurrentMode != FormViewMode.ReadOnly)
            {

                ////using data value in form in custom way

                //populating per-fill data
                if (formViewEmployee.CurrentMode == FormViewMode.Insert)
                {
                    txtFirstName.Text = "Ashraful";
                    txtLastName.Text = "Alam";
                    txtHireDate.Text = DateTime.Now.ToString();
                    txtAddress.Text = "One Microsoft Way";
                    txtHomePhone.Text = "912200022";
                    ddlCountry.Items.FindByText("USA").Selected = true;
                }
            }
        }
开发者ID:shvro,项目名称:eisk,代码行数:27,代码来源:UITestDataHelper.cs

示例5: SetDefaultValue

		/// <summary>
      /// Sets the default value of the control with the specified id parameter when
      /// the <see cref="FormView"/> is in Insert mode.
      /// </summary>
      /// <param name="formView">The form view.</param>
      /// <param name="controlID">The control ID.</param>
      /// <param name="value">The value.</param>
      public static void SetDefaultValue(FormView formView, String controlID, String value)
      {
         if (formView != null && formView.CurrentMode == FormViewMode.Insert)
         {
            Control control = formView.FindControl(controlID);

            if (control != null)
            {
               SetValue(control, value);
            }
         }
      }
开发者ID:pratik1988,项目名称:VedicKart,代码行数:19,代码来源:FormUtilBase.generated.cs

示例6: InitPassword

		/// <summary>
		/// Initializes a password <see cref="TextBox"/> control with the current value.
		/// </summary>
		/// <param name="formView">A <see cref="FormView"/> object.</param>
		/// <param name="controlId">The control's ID property value.</param>
		/// <param name="dataSource">The associated <see cref="ILinkedDataSource"/> object.</param>
		/// <param name="propertyName">The property name that the <see cref="TextBox"/> is bound to.</param>
		public static void InitPassword(FormView formView, String controlId, ILinkedDataSource dataSource, String propertyName)
		{
			if ( formView != null && !formView.Page.IsPostBack && dataSource != null &&
				!String.IsNullOrEmpty(controlId) && !String.IsNullOrEmpty(propertyName) )
			{
				TextBox input = formView.FindControl(controlId) as TextBox;
				if ( input != null )
				{
					Object entity = dataSource.GetCurrentEntity();
					if ( entity != null )
					{
						String password = EntityUtil.GetPropertyValue(entity, propertyName) as String;
						InitPassword(input, password);
					}
				}
			}
		}
开发者ID:pratik1988,项目名称:VedicKart,代码行数:24,代码来源:FormUtilBase.generated.cs

示例7: getInternalValueFromForm

 /// <summary>
 /// Devuelve el valor de la propiedad Text de un TextBox contenido dentro de un FormView o un valor por defecto en caso no encontrarlo.
 /// </summary>
 /// <param name="f">FormView del cual se quiere sacar el valor del campo de texto</param>
 /// <param name="Id">String Id del TextBox dentro del FormView</param>
 /// <param name="DefaultValue">El valor por defecto en caso de no encontrar el DropDownList en el FormView</param>
 /// <returns>El valor de la propiedad Text del TextBox pasado como parametro o null si no lo encuentra.</returns>
 public static String getInternalValueFromForm(FormView f, String Id, String DefaultValue)
 {
     TextBox t = (TextBox)f.FindControl(Id);
     if (t != null)
     {
         return t.Text;
     }
     else return DefaultValue;
 }
开发者ID:royriojas,项目名称:RGEN2,代码行数:16,代码来源:utilidades.cs

示例8: getInternalValueFromDropDownList

 /// <summary>
 /// Devuelve el valor de la propiedad SelectedValue de un DropDownList contenido en un FormView o un valor por defecto
 /// </summary>
 /// <param name="frm">FormView que contiene el DropDownList</param>
 /// <param name="cbxName">Id del DropDownList contenido en el FormView</param>      
 /// <param name="DefaultValue">El valor por defecto a devolver en caso no encontrar el componente</param>
 /// <returns>El valor de la propiedad SelectedValue o cadena vacía en caso no encontrarlo</returns>
 public static String getInternalValueFromDropDownList(FormView frm, string cbxName, String DefaultValue)
 {
     DropDownList cbx = (DropDownList)frm.FindControl(cbxName);
     if (cbx != null) return cbx.SelectedValue;
     else return DefaultValue;
 }
开发者ID:royriojas,项目名称:RGEN2,代码行数:13,代码来源:utilidades.cs

示例9: setInternalValueCheckBox

        public static void setInternalValueCheckBox(String CheckBoxId, Boolean value, FormView frm)
        {
            CheckBox t = (CheckBox)frm.FindControl(CheckBoxId);

            if (t != null)
            {
              t.Checked = value;
            }
        }
开发者ID:royriojas,项目名称:Clave-Projects,代码行数:9,代码来源:Utilidades.cs

示例10: setInternalValueASB

        public static void setInternalValueASB(String ASBId, String value, FormView frm)
        {
            ASB.AutoSuggestBox t = null;
            try
            {
              t = (ASB.AutoSuggestBox)frm.FindControl(ASBId);
            }
            catch (Exception ex)
            {
              LoggerFacade.LogException(ex);
              t = null;
            }

            if (t != null)
            {
              t.SelectedValue = value;
            }
        }
开发者ID:royriojas,项目名称:Clave-Projects,代码行数:18,代码来源:Utilidades.cs

示例11: setInternalValue

        public static void setInternalValue(String TextBoxId, String value, FormView frm)
        {
            TextBox t = frm.FindControl(TextBoxId) as TextBox;

              if (t != null)
              {
            t.Text = value;
              }
        }
开发者ID:royriojas,项目名称:Clave-Projects,代码行数:9,代码来源:Utilidades.cs

示例12: getInternalValueFromFormCheckBox

 /// <summary>
 /// Devuelve el valor de la propiedad Text de un CheckBox contenido dentro de un FormView.
 /// </summary>
 /// <param name="f">FormView del cual se quiere sacar el valor del campo de texto</param>
 /// <param name="Id">String Id del TextBox dentro del FormView</param>
 /// <returns>El valor de la propiedad Text del CheckBox pasado como parametro o null si no lo encuentra.</returns>
 public static Boolean getInternalValueFromFormCheckBox(FormView f, String Id)
 {
     CheckBox t = (CheckBox)f.FindControl(Id);
       if (t != null)
       {
     return t.Checked;
       }
       else return false;
 }
开发者ID:royriojas,项目名称:Clave-Projects,代码行数:15,代码来源:Utilidades.cs

示例13: getInternalTextFromDropDownList

 /// <summary>
 /// Devuelve el valor de la propiedad Text del Item Seleccionado de un DropDownList contenido en un FormView
 /// </summary>
 /// <param name="frm">FormView que contiene el DropDownList</param>
 /// <param name="cbxName">Id del DropDownList contenido en el FormView</param>
 /// <returns>El valor de la propiedad Text o null</returns>
 public static String getInternalTextFromDropDownList(FormView frm, string cbxName)
 {
     DropDownList cbx = (DropDownList)frm.FindControl(cbxName);
       if (cbx != null) return cbx.SelectedItem.Text;
       else return null;
 }
开发者ID:royriojas,项目名称:Clave-Projects,代码行数:12,代码来源:Utilidades.cs


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