• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# WebControls.FormView类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



FormView类属于System.Web.UI.WebControls命名空间,在下文中一共展示了FormView类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: 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


示例3: 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


示例4: 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


示例5: BindFormView

 public FormView BindFormView(FormView grdVGenIn, string strSqlIn)
 {
     objConnection = open_connection();
     if (open_con == true)
     {
         try
         {
             objDataSet = new DataSet();
             objAdapter = new OracleDataAdapter(strSqlIn, objConnection);
             objAdapter.Fill(objDataSet, "tblGrdV");
             grdVGenIn.DataSource = objDataSet.Tables["tblGrdV"].DefaultView;
             grdVGenIn.DataBind();
             gridView_bind = true;
             return grdVGenIn;
         }
         catch (OracleException objError)
         {
             if (objError.Message.Substring(0, 21) == "Table does not exist.")
             {
                 ErrorStr = ErrorMsg(objConnection, "MSG1201");
             }
             else if (objError.Message.Substring(59, 25) == "ORA-00904: invalid column name")
             {
                 ErrorStr = ErrorMsg(objConnection, "MSG1202");
             }
             else
             {
                 ErrorStr = objError.Message;
                 err_flag = true;
             }
             gridView_bind = false;
             return null;
         }
         finally
         {
             objConnection.Close();
             objConnection.Dispose();
             objAdapter.Dispose();
         }
     }
     else
     {
         return null;
     }
 }
开发者ID:knkbhatia,项目名称:materialallocationatconstructionsite,代码行数:45,代码来源:OracleDataAccess.cs


示例6: Build

 public void Build(FormView form, IConfigurationSection section, IBinder binder, IDictionary<string, object> boundControls, IDictionary<string, object> dataSources)
 {
     if (null == form)
     {
         throw new ArgumentNullException("form");
     }
     if (null == section)
     {
         throw new ArgumentNullException("section");
     }
     if (null == binder)
     {
         throw new ArgumentNullException("binder");
     }
     this._boundControls = boundControls;
     this._boundControls.Clear();
     this._dataSources = dataSources;
     this._dataSources.Clear();
     form.EditItemTemplate = new TemplateHelper(this.BuildItemTemplate(section, binder, FormViewMode.Edit), section);
 }
开发者ID:t1b1c,项目名称:lwas,代码行数:20,代码来源:FormViewBuilder.cs


示例7: RedirectAfterDelete

		/// <summary>
        /// Redirects the client to a new URL after the ItemDeleted event of
        /// the <see cref="FormView"/> object has been raised.
        /// </summary>
        /// <param name="formView">A <see cref="FormView"/> object.</param>
        /// <param name="url">The target location.</param>
        public static void RedirectAfterDelete(FormView formView, String url)
        {
            RedirectAfterDelete(formView, url, null);
        }
开发者ID:pratik1988,项目名称:VedicKart,代码行数:10,代码来源:FormUtilBase.generated.cs


示例8: SetOnUpdating

		/// <summary>
		/// Sets the values to update using the specified names and values.
		/// </summary>
		/// <param name="formView">A <see cref="FormView"/> object.</param>
		/// <param name="names">The property names.</param>
		/// <param name="values">The property values.</param>
		public static void SetOnUpdating(FormView formView, String[] names, Object[] values)
		{
			formView.ItemUpdating += new FormViewUpdateEventHandler(
				delegate(object sender, FormViewUpdateEventArgs e)
				{
					SetValues(e.NewValues, names, values);
				}
			);
		}
开发者ID:pratik1988,项目名称:VedicKart,代码行数:15,代码来源:FormUtilBase.generated.cs


示例9: SetDefaultMode

		/// <summary>
		/// Sets the data-entry mode of the specified <see cref="FormView"/> object based
		/// on whether or not the <see cref="HttpRequest"/> parameter value is null.
		/// </summary>
		/// <param name="formView">A <see cref="FormView"/> object.</param>
		/// <param name="requestParameterName">The <see cref="HttpRequest"/> parameter name.</param>
		public static void SetDefaultMode(FormView formView, String requestParameterName)
		{
			if ( String.IsNullOrEmpty(HttpContext.Current.Request[requestParameterName]) )
			{
				formView.DefaultMode = FormViewMode.Insert;
				HideButton(formView, "UpdateButton");
			}
			else
			{
				formView.DefaultMode = FormViewMode.Edit;
				HideButton(formView, "InsertButton");
			}
		}
开发者ID:pratik1988,项目名称:VedicKart,代码行数:19,代码来源:FormUtilBase.generated.cs


示例10: 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


示例11: 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


示例12: BindOnInserting

 /// <summary>
 /// Binds a property's value to a <see cref="FormView" /> child control when the <see cref="FormView"/> is inserting.
 /// </summary>
 /// <param name="formView">A <see cref="FormView"/> object.</param>
 /// <param name="propertyName">The name of the property to bind the value to.</param>
 /// <param name="controlId">The id of child control that contains the desired value.</param>
 public static void BindOnInserting(FormView formView, string propertyName, string controlId)
 {
    if (formView != null)
    {
       formView.ItemInserting += new FormViewInsertEventHandler(
       delegate(object sender, FormViewInsertEventArgs e)
       {
          BindControl(formView, e.Values, propertyName, controlId);
       }
    );
    }
 }
开发者ID:pratik1988,项目名称:VedicKart,代码行数:18,代码来源:FormUtilBase.generated.cs


示例13: ClearFormView

 public FormView ClearFormView(FormView grdVGenIn)
 {
     grdVGenIn.DataSource = null;
     grdVGenIn.DataBind();
     return null;
 }
开发者ID:knkbhatia,项目名称:materialallocationatconstructionsite,代码行数:6,代码来源:OracleDataAccess.cs


示例14: RedirectAfterUpdateCancel

		/// <summary>
		/// Redirect the client to a new URL after an update or cancel operation.
		/// </summary>
		/// <param name="formView">A <see cref="FormView"/> object.</param>
		/// <param name="url">The target location.</param>
		public static void RedirectAfterUpdateCancel(FormView formView, String url)
		{
			RedirectAfterUpdateCancel(formView, url, null);
		}
开发者ID:pratik1988,项目名称:VedicKart,代码行数:9,代码来源:FormUtilBase.generated.cs


示例15: RedirectAfterCancel

		/// <summary>
		/// Redirects the client to a new URL after the ItemCommand event of
		/// the <see cref="FormView"/> object has been raised with a CommandName
		/// of "Cancel".
		/// </summary>
		/// <param name="formView">A <see cref="FormView"/> object.</param>
		/// <param name="url">The target location.</param>
		/// <param name="dataSource">The associated <see cref="ILinkedDataSource"/> object.</param>
		public static void RedirectAfterCancel(FormView formView, String url, ILinkedDataSource dataSource)
		{
			formView.ItemCommand += new FormViewCommandEventHandler(
				delegate(object sender, FormViewCommandEventArgs e)
				{
					// cancel button
					if ( String.Compare("Cancel", e.CommandName, true) == 0 )
					{
						Redirect(url, dataSource);
					}
				}
			);
		}
开发者ID:pratik1988,项目名称:VedicKart,代码行数:21,代码来源:FormUtilBase.generated.cs


示例16: FormViewRow_BubbleEvent

		public void FormViewRow_BubbleEvent ()
		{
			FormView fv = new FormView ();
			PokerFormViewRow row = new PokerFormViewRow (2, DataControlRowType.Footer, DataControlRowState.Insert);
			Button bt=new Button ();
			fv.Controls.Add (row);			
			CommandEventArgs com=new CommandEventArgs (new CommandEventArgs ("Delete",null));
			fv.ItemDeleting += new FormViewDeleteEventHandler (R_DataBinding);
			Assert.AreEqual (false, dataDeleting, "BeforeBubbleEvent");
			row.DoOnBubbleEvent (row,com);
			Assert.AreEqual (true, dataDeleting, "AfterBubbleEvent");
			fv.ChangeMode (FormViewMode.Insert); 
			com = new CommandEventArgs (new CommandEventArgs ("Insert", null));
			fv.ItemInserting += new FormViewInsertEventHandler (dv_ItemInserting);
			Assert.AreEqual (false, dataInserting, "BeforeInsertBubbleEvent");
			row.DoOnBubbleEvent (row, com);
			Assert.AreEqual (true, dataInserting, "AfterInsertBubbleEvent");
			fv.ChangeMode (FormViewMode.Edit);
			com = new CommandEventArgs (new CommandEventArgs ("Update", null));
			fv.ItemUpdating += new FormViewUpdateEventHandler (dv_ItemUpdating);
			Assert.AreEqual (false, dataUpdating, "BeforeUpdateBubbleEvent");
			row.DoOnBubbleEvent (row, com);
			Assert.AreEqual (true, dataUpdating, "AfterUpdateBubbleEvent");
			fv.ItemUpdating += new FormViewUpdateEventHandler (dv_ItemUpdating);

  
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:27,代码来源:FormViewRowTest.cs


示例17: 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


示例18: 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


示例19: RedirectAfterInsertUpdateCancel

		/// <summary>
		/// Redirect the client to a new URL after an insert, update, or cancel operation.
		/// </summary>
		/// <param name="formView">A <see cref="FormView"/> object.</param>
		/// <param name="url">The target location.</param>
		/// <param name="dataSource">The associated <see cref="ILinkedDataSource"/> object.</param>
		public static void RedirectAfterInsertUpdateCancel(FormView formView, String url, ILinkedDataSource dataSource)
		{
			RedirectAfterInsert(formView, url, dataSource);
			RedirectAfterUpdate(formView, url, dataSource);
			RedirectAfterCancel(formView, url, dataSource);
		}
开发者ID:pratik1988,项目名称:VedicKart,代码行数:12,代码来源:FormUtilBase.generated.cs


示例20: OnInit

        protected override void OnInit(EventArgs e)
        {
            LinkButton dummyLink = new LinkButton();
            dummyLink.ID = "dummyLink";
            this.Controls.Add(dummyLink);
            UpdatePanelDynamic linkUpdatePanel = new UpdatePanelDynamic();
            this.Controls.Add(linkUpdatePanel);
            _link = new LinkButton();
            _link.ID = "selectorLauncher";
            _link.Text = "";
            linkUpdatePanel.ContentTemplateContainer.Controls.Add(_link);
            this.Link.Click += new EventHandler(Link_Click);
            _container = new Panel();
            _container.ID = "selectorContainer";
            _container.CssClass = "selector_modalPopup";
            _container.Style.Add("display", "none");
            _searchPanel = new Panel();
            _searchPanel.ID = "searchPanel";
            _searchPanel.CssClass = "selector_searchpanel";
            _container.Controls.Add(_searchPanel);
            _buttonsPanel = new Panel();
            _buttonsPanel.ID = "buttonsPanel";
            _buttonsPanel.CssClass = "selector_buttonspanel";
            _container.Controls.Add(_buttonsPanel);
            this.UpdatePanel = new UpdatePanelDynamic();
            this.UpdatePanel.ID = "updatePanel";
            this.resultsSelectedIndexHidden = new HiddenField();
            this.resultsSelectedIndexHidden.ID = "resultsSelectedIndexHidden";
            this.UpdatePanel.ContentTemplateContainer.Controls.Add(this.resultsSelectedIndexHidden);
            visibilityHidden = new HiddenField();
            visibilityHidden.ID = "visibilityHidden";
            this.UpdatePanel.ContentTemplateContainer.Controls.Add(visibilityHidden);
            _titleLabel = new Label();
            _titleLabel.CssClass = "selector_title";
            this.UpdatePanel.ContentTemplateContainer.Controls.Add(_titleLabel);
            _criteriaDataSource = new DataTableDataSource();
            _criteriaDataSource.ID = "criteriaDataSource";
            this.UpdatePanel.ContentTemplateContainer.Controls.Add(_criteriaDataSource);
            Panel criteriaPanel = new Panel();
            criteriaPanel.CssClass = "selector_criteriaPanel";
            _criteria = new FormView();
            _criteria.ID = "Criteria";
            _criteria.CssClass = "selector_criteria";
            _criteria.DefaultMode = FormViewMode.Edit;
            criteriaPanel.Controls.Add(_criteria);
            this.UpdatePanel.ContentTemplateContainer.Controls.Add(criteriaPanel);
            Panel searchButtonPanel = new Panel();
            searchButtonPanel.CssClass = "selector_searchButtonPanel";
            _searchButton = new OneClickButton();
            _searchButton.ID = "searchButton";
            _searchButton.Text = _searchText;
            _searchButton.Click += new EventHandler(this.searchButton_Click);
            searchButtonPanel.Controls.Add(_searchButton);
            this.UpdatePanel.ContentTemplateContainer.Controls.Add(searchButtonPanel);
            Panel resultsContainer = new Panel();
            resultsContainer.ID = "resultsContainer";
            resultsContainer.CssClass = "selector_results";
            _results = new DataGridView();
            _results.ID = "Results";
            _results.AutoGenerateSelectButton = true;

            if (null != _selectorSource)
                _results.DataSource = _selectorSource;

            resultsContainer.Controls.Add(_results);
            this.UpdatePanel.ContentTemplateContainer.Controls.Add(resultsContainer);
            _searchPanel.Controls.Add(this.UpdatePanel);
            _okButton = new Button();
            _okButton.ID = "okButton";
            _okButton.Text = _okText;
            _buttonsPanel.Controls.Add(_okButton);
            _cancelButton = new Button();
            _cancelButton.ID = "cancelButton";
            _cancelButton.Text = _cancelText;
            _buttonsPanel.Controls.Add(_cancelButton);
            this.Controls.Add(_container);
            _container.DefaultButton = "searchButton";
            this.PopupExtender = new ModalPopupExtender();
            this.PopupExtender.ID = "popupExtender";
            this.PopupExtender.TargetControlID = "dummyLink";
            this.PopupExtender.PopupControlID = "selectorContainer";
            this.PopupExtender.BackgroundCssClass = "selector_modalBackground";
            this.PopupExtender.OkControlID = "okButton";
            this.PopupExtender.CancelControlID = "cancelButton";
            this.PopupExtender.DropShadow = true;
            this.PopupExtender.PopupDragHandleControlID = "selectorContainer";
            this.Controls.Add(this.PopupExtender);

            if (this.shouldShow)
                this.DoShow();
            if (this.shouldHide)
                this.DoHide();

            base.OnInit(e);
            this.Results.SelectedIndexChanged += new EventHandler(this.Results_SelectedIndexChanged);
        }
开发者ID:t1b1c,项目名称:lwas,代码行数:96,代码来源:Selector.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# WebControls.FormViewCommandEventArgs类代码示例发布时间:2022-05-26
下一篇:
C# WebControls.FileUpload类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap