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

C# HiddenField类代码示例

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

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



HiddenField类属于命名空间,在下文中一共展示了HiddenField类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CreateChildControls

    protected override void CreateChildControls()
    {
        _state = new HiddenField {ID = ID + "_state"};
        _state.ValueChanged += HandleLinkRequest;

        Controls.Add(_state);
    }
开发者ID:ssommerfeldt,项目名称:TAC_EAB,代码行数:7,代码来源:ClientLinkHandler.ascx.cs


示例2: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        // Set body to submit onload
        body.Attributes.Add("onload", "document.forms[0].submit()");

        // Set form action and method
        paypalForm.Action = "https://www.sandbox.paypal.com/cgi-bin/webscr"; // TEST URL
        paypalForm.Method = "POST";

        // Retrieve donations from the session
        var donations = BusinessLogic.Donation.GetDonations();

        // Determine donation type
        if (donations.Count() > 1)
        {
            this.processingType = ProcessingType.Cart;
        }
        else
        {
            if (donations.First().DonationType == "Special")
            {
                this.processingType = ProcessingType.OneTime;
            }
            else
            {
                this.processingType = ProcessingType.Recurring;
            }
        }

        // Create collection to store values in
        Dictionary<string, string> formValues = new Dictionary<string, string>();

        // Set default values
        formValues.Add("business", "[email protected]");
        formValues.Add("no_shipping", "2");
        formValues.Add("currency_code", "USD");
        formValues.Add("tax", "0");
        formValues.Add("no_note", "1");

        // Add type specific values to collection
        var addedFormValues = this.AddTypeSpecificValues(donations);
        addedFormValues.ToList().ForEach(x => formValues.Add(x.Key, x.Value));

        // Add hidden fields to form
        foreach (KeyValuePair<string, string> pair in formValues)
        {
            HiddenField field = new HiddenField();
            field.ID = (string)pair.Key;
            field.Value = (string)pair.Value;

            paypalForm.Controls.Add(field);
        }

        // Clear session so that donations are not saved when the user returns
        BusinessLogic.Donation.ClearDonations();
    }
开发者ID:OneMissionSociety,项目名称:OMS-Corporate-Website,代码行数:56,代码来源:ProcessDonations.aspx.cs


示例3: PopulateHiddenField

 /// <summary>
 /// Populates the value of the specified hidden field with the data
 /// associated with the specified querystring param. Populates the 
 /// field with an empty string if parameter does not exist.
 /// </summary>
 /// <param name="hiddenField">HiddenField to populate</param>
 /// <param name="queryStringParam">Query string parameter</param>
 private void PopulateHiddenField(HiddenField hiddenField, string queryStringParam)
 {
     if (!string.IsNullOrEmpty(Request.QueryString[queryStringParam]))
     {
         hiddenField.Value = Request.QueryString[queryStringParam];
     }
     else
     {
         hiddenField.Value = string.Empty;
     }
 }
开发者ID:jaytem,项目名称:minGit,代码行数:18,代码来源:DmsSync.aspx.cs


示例4: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (PreviousPage != null)
        {
            ob = (HiddenField)PreviousPage.FindControl("HiddenFieldconstituencyId");
        }
        if (ob != null)
        {

            Int16 constituencyId = Convert.ToInt16(ob.Value);
            loadmpdetails(constituencyId);

        }
    }
开发者ID:CoderAjay,项目名称:FinalWebrmp,代码行数:14,代码来源:mpprofile.aspx.cs


示例5: GridView1_RowDataBound

 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         OperaterDropDownList = (DropDownList)e.Row.Cells[1].FindControl("selOperator");
         OperaterDropDownList.Attributes.Add("onchange", "OperatorChange(this);");
         // add by zy 20110107 start
         string fieldName = ((System.Data.DataRowView)(e.Row.DataItem)).Row.ItemArray[2].ToString();
         TextBox TBCondiction1 = (TextBox)e.Row.Cells[2].FindControl("txtCondition1");
         HtmlImage IBSelect = (HtmlImage)e.Row.Cells[3].FindControl("imgSelect");
         IBSelect.Attributes.Add("onclick", string.Format("topopmask('../SelectReportCondiction.aspx',800,450,'Select Report Condition','{0}','{1}');", TBCondiction1.ClientID, fieldName));
         // add by zy 20110107 end
         FieldTypeHiddenField = (HiddenField)e.Row.Cells[3].FindControl("hidFieldType");
         BoundOperater(OperaterDropDownList, FieldTypeHiddenField.Value);
     }
 }
开发者ID:gracianani,项目名称:SINO_CRM,代码行数:16,代码来源:ExecutiveReportCondition.aspx.cs


示例6: CreatePageControl

    private void CreatePageControl()
    {
        // Create dynamic controls here.
        btnNextPage = new Button();
        btnNextPage.ID = "btnNextPage";
        Form1.Controls.Add(btnNextPage);
        btnNextPage.Click += new System.EventHandler(btnNextPage_Click);

        btnPreviousPage = new Button();
        btnPreviousPage.ID = "btnPreviousPage";
        Form1.Controls.Add(btnPreviousPage);
        btnPreviousPage.Click += new System.EventHandler(btnPreviousPage_Click);

        btnGoPage = new Button();
        btnGoPage.ID = "btnGoPage";
        Form1.Controls.Add(btnGoPage);
        btnGoPage.Click += new System.EventHandler(btnGoPage_Click);

        HFD_CurrentPage = new HiddenField();
        HFD_CurrentPage.Value = "1";
        HFD_CurrentPage.ID = "HFD_CurrentPage";
        Form1.Controls.Add(HFD_CurrentPage);
    }
开发者ID:samuellin124,项目名称:cms,代码行数:23,代码来源:ServicePoints.aspx.cs


示例7: Page_Load

	protected void Page_Load(object sender, EventArgs e)
	{
		((BXAdminMasterPage)Page.Master).Title = Page.Title;

		if (userId > 0)
			BXRoleManager.SynchronizeProviderUserRoles(user.UserName, user.ProviderName);

		var filter = new BXFormFilter(
			new BXFormFilterItem("Active", true, BXSqlFilterOperators.Equal)
		);
		var roles = userId > 0 ? rolesToViewAndModify : rolesToCreate;
		if (roles.Length != 1 || roles[0] != 0)
			filter.Add(new BXFormFilterItem("Id", roles, BXSqlFilterOperators.In));

		BXRoleCollection rolesTmp = BXRoleManager.GetList(
			filter,
			new BXOrderBy_old("RoleName", "Asc")
		);

		foreach (int i in new[] { 1, 3, 2 })
		{
			var r = rolesTmp.Find(x => x.RoleId == i);
			if (r != null)
			{
				rolesTmp.Remove(r);
				rolesTmp.Insert(0, r);
			}
		}


		foreach (BXRole roleTmp in rolesTmp)
		{
			HtmlTableRow r1 = new HtmlTableRow();
			r1.VAlign = "top";

			HtmlTableCell c1 = new HtmlTableCell();
			CheckBox cb = new CheckBox();
			cb.ID = String.Format("tbCheck_{0}", roleTmp.RoleId.ToString());
			cb.Checked = false;
			c1.Controls.Add(cb);
			HiddenField hf = new HiddenField();
			hf.ID = String.Format("tbCheck_{0}_old", roleTmp.RoleId.ToString());
			hf.Value = "N";
			c1.Controls.Add(hf);
			r1.Cells.Add(c1);

			c1 = new HtmlTableCell();
			c1.InnerHtml = String.Format("<a href=\"AuthRolesEdit.aspx?name={0}\">{1}</a>", Server.UrlEncode(roleTmp.RoleName), Server.HtmlEncode(roleTmp.Title));
			r1.Cells.Add(c1);

			c1 = new HtmlTableCell();
			c1.Align = "center";
			c1.Style["padding-right"] = "10px";
			c1.Style["padding-left"] = "10px";
			TextBox tb1 = new TextBox();
			tb1.ID = String.Format("tbActiveFrom_{0}", roleTmp.RoleId.ToString());
			c1.InnerHtml = "c&nbsp;";
			c1.Controls.Add(tb1);
			hf = new HiddenField();
			hf.ID = String.Format("tbActiveFrom_{0}_old", roleTmp.RoleId.ToString());
			hf.Value = "";
			c1.Controls.Add(hf);
			r1.Cells.Add(c1);

			c1 = new HtmlTableCell();
			c1.Align = "center";
			tb1 = new TextBox();
			tb1.ID = String.Format("tbActiveTo_{0}", roleTmp.RoleId.ToString());
			c1.InnerHtml = string.Format("{0}&nbsp;", GetMessage("TabCellInnerHtml.To"));
			c1.Controls.Add(tb1);
			hf = new HiddenField();
			hf.ID = String.Format("tbActiveTo_{0}_old", roleTmp.RoleId.ToString());
			hf.Value = "";
			c1.Controls.Add(hf);
			r1.Cells.Add(c1);

			tblRoles.Rows.Add(r1);
		}

		if (!Page.IsPostBack)
			LoadData();

		if (userId > 0)
		{
			if (!missingProvider)
			{
				trPasswordQuestion.Style["display"] = (Membership.Providers[user.ProviderName].RequiresQuestionAndAnswer ? "" : "none");
				trPasswordAnswer.Style["display"] = (Membership.Providers[user.ProviderName].RequiresQuestionAndAnswer ? "" : "none");
			}
			else
			{
				trPasswordQuestion.Style["display"] = "none";
				trPasswordAnswer.Style["display"] = "none";
				trPassword.Style["display"] = "none";
				trNewPassword.Style["display"] = "none";
				trNewPasswordConf.Style["display"] = "none";
			}
		}
		else
		{
//.........这里部分代码省略.........
开发者ID:mrscylla,项目名称:volotour.ru,代码行数:101,代码来源:AuthUsersEdit.aspx.cs


示例8: CreatePageControl

    private void CreatePageControl()
    {
        // Create dynamic controls here.
        btnNextPage = new Button();
        btnNextPage.ID = "btnNextPage";
        btnNextPage.Height = 1;
        btnNextPage.Width = 1;
        Form1.Controls.Add(btnNextPage);
        btnNextPage.Click += new System.EventHandler(btnNextPage_Click);

        btnPreviousPage = new Button();
        btnPreviousPage.ID = "btnPreviousPage";
        Form1.Controls.Add(btnPreviousPage);
        btnPreviousPage.Click += new System.EventHandler(btnPreviousPage_Click);

        btnGoPage = new Button();
        btnGoPage.ID = "btnGoPage";
        Form1.Controls.Add(btnGoPage);
        btnGoPage.Click += new System.EventHandler(btnGoPage_Click);

        HFD_CurrentPage = new HiddenField();
        HFD_CurrentPage.Value = "1";
        HFD_CurrentPage.ID = "HFD_CurrentPage";
        Form1.Controls.Add(HFD_CurrentPage);

        HFD_CurrentSortField = new HiddenField();
        HFD_CurrentSortField.Value = "";
        HFD_CurrentSortField.ID = "HFD_CurrentSortField";
        Form1.Controls.Add(HFD_CurrentSortField);

        HFD_CurrentSortDir = new HiddenField();
        HFD_CurrentSortDir.Value = "asc";
        HFD_CurrentSortDir.ID = "HFD_CurrentSortDir";
        Form1.Controls.Add(HFD_CurrentSortDir);
    }
开发者ID:samuellin124,项目名称:cms,代码行数:35,代码来源:ChangeChurchEdit.aspx.cs


示例9: readPage

 public void readPage(SqlConnection con)
 {
     string value = Context.Request["it"];
     if (value == null)
         return;
     ((HiddenField)Master.FindControl("PageIndex")).Value = value;
     SqlCommand cmd = new SqlCommand("SELECT * FROM [Url] WHERE [it] = @it ORDER BY [index]", con);
     cmd.Parameters.AddWithValue("@it", value);
     SqlDataReader reader = cmd.ExecuteReader();
     for (int i = 1; reader.Read(); i++)
     {
         HiddenField hid = new HiddenField();
         hid.ID = "page" + i.ToString();
         hid.Value = reader["url"].ToString();
         Url.Controls.Add(hid);
     }
     reader.Close();
 }
开发者ID:The---onE,项目名称:dmtucao.com,代码行数:18,代码来源:it.aspx.cs


示例10: SetHiddenValues

    /// <summary>
    /// Sets array list values into hidden field.
    /// </summary>
    /// <param name="values">Arraylist of values to selection</param>
    /// <param name="field">Hidden field</param>
    private static void SetHiddenValues(ArrayList values, HiddenField actionsField, HiddenField hashField)
    {
        if (values != null)
        {
            if (actionsField != null)
            {
                // Build the list of actions
                StringBuilder sb = new StringBuilder();
                sb.Append("|");

                foreach (object value in values)
                {
                    sb.Append(value);
                    sb.Append("|");
                }

                // Action IDs
                string actions = sb.ToString();
                actionsField.Value = actions;

                // Actions hash
                if (hashField != null)
                {
                    hashField.Value = ValidationHelper.GetHashString(actions);
                }
            }
        }
    }
开发者ID:KuduApps,项目名称:Kentico,代码行数:33,代码来源:UniGrid.ascx.cs


示例11: GetHiddenValues

 /// <summary>
 /// Returns array list from hidden field.
 /// </summary>
 /// <param name="field">Hidden field with values separated with |</param>
 private static ArrayList GetHiddenValues(HiddenField field)
 {
     string hiddenValue = field.Value.Trim('|');
     ArrayList list = new ArrayList();
     string[] values = hiddenValue.Split('|');
     foreach (string value in values)
     {
         if (!list.Contains(value))
         {
             list.Add(value);
         }
     }
     list.Remove("");
     return list;
 }
开发者ID:KuduApps,项目名称:Kentico,代码行数:19,代码来源:UniGrid.ascx.cs


示例12: ClearHiddenValues

 /// <summary>
 /// Clears all selected items from hidden values.
 /// </summary>
 /// <param name="field">Hidden field</param>
 private static void ClearHiddenValues(HiddenField field)
 {
     if (field != null)
     {
         field.Value = "";
     }
 }
开发者ID:KuduApps,项目名称:Kentico,代码行数:11,代码来源:UniGrid.ascx.cs


示例13: ValidateHiddenValues

 /// <summary>
 /// Validates values in hidden fields with corresponding hash.
 /// </summary>
 /// <param name="field">Hidden field with values separated with |</param>
 /// <param name="hashField">Hidden field containing hash of <paramref name="field"/></param>
 private static bool ValidateHiddenValues(HiddenField field, HiddenField hashField)
 {
     return ValidationHelper.ValidateHash(field.Value, hashField.Value, redirect: false);
 }
开发者ID:dlnuckolls,项目名称:pfh-paypalintegration,代码行数:9,代码来源:UniGrid.ascx.cs


示例14: GetHiddenValues

    /// <summary>
    /// Returns array list from hidden field.
    /// </summary>
    /// <param name="field">Hidden field with values separated with |</param>
    /// <param name="hashField">Hidden field containing hash of <paramref name="field"/></param>
    private static List<string> GetHiddenValues(HiddenField field, HiddenField hashField)
    {
        var result = new List<string>();

        if (ValidateHiddenValues(field, hashField))
        {
            result.AddRange(field.Value.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries).Distinct(StringComparer.InvariantCultureIgnoreCase).ToList());
        }

        return result;
    }
开发者ID:dlnuckolls,项目名称:pfh-paypalintegration,代码行数:16,代码来源:UniGrid.ascx.cs


示例15: ClearHiddenValues

 /// <summary>
 /// Clears all selected items from hidden values.
 /// </summary>
 /// <param name="field">Hidden field</param>
 private static void ClearHiddenValues(HiddenField field)
 {
     if (field != null)
     {
         field.Value = String.Empty;
     }
 }
开发者ID:dlnuckolls,项目名称:pfh-paypalintegration,代码行数:11,代码来源:UniGrid.ascx.cs


示例16: CreateChildControls

    /// <summary>
    /// Child control creation.
    /// </summary>
    protected override void CreateChildControls()
    {
        // Add product button
        this.btnRemoveProduct = new CMSButton();
        this.btnRemoveProduct.Attributes["style"] = "display: none";
        this.Controls.Add(this.btnRemoveProduct);
        this.btnRemoveProduct.Click += new EventHandler(btnRemoveProduct_Click);

        // Add the hidden fields for productId
        this.hidProductID = new HiddenField();
        this.hidProductID.ID = "hidProductID";
        this.Controls.Add(this.hidProductID);

        base.CreateChildControls();
    }
开发者ID:KuduApps,项目名称:Kentico,代码行数:18,代码来源:Wishlist.ascx.cs


示例17: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString.HasKeys())
        {
            string numTemplates = Request.QueryString["HD_NumberTemplates"];
            // Get the number of templates that remain to be uploaded.
            int.TryParse(numTemplates, out RemainingTemplates);

            // If this is the first time at the page, the number of remaining templates is the same as the total number of templates.
            if (string.IsNullOrEmpty(TotalTemplateCount.Value))
            {
                TotalTemplateCount.Value = RemainingTemplates.ToString();
                SuccessfulUploadItems.Clear();
                ConflictUploadItems.Clear();
                CanceledUploadItems.Clear();
            }
            TotalNumTemplates = int.Parse(TotalTemplateCount.Value);
        }

        UpdatePanelVisibility();

        if (RemainingTemplates > 0)
        {
            UploadedTemplatesGrid.Rows.Clear();

            for (int i = 0; i < GridSize; i++)
            {
                System.Web.UI.HtmlControls.HtmlTableRow tr = new System.Web.UI.HtmlControls.HtmlTableRow();
                System.Web.UI.HtmlControls.HtmlTableCell tc;

                // Template Title
                tc = new System.Web.UI.HtmlControls.HtmlTableCell();
                tc.Width = "30%";
                TextBox templateTitle = new TextBox();
                templateTitle.ID = string.Format("HD_Template_Title{0}", i.ToString());
                templateTitle.Rows = 3;
                templateTitle.TextMode = TextBoxMode.MultiLine;
                tc.Controls.Add(templateTitle);
                tr.Controls.Add(tc);

                // Template Description
                tc = new System.Web.UI.HtmlControls.HtmlTableCell();
                tc.Width = "70%";
                TextBox templateDescription = new TextBox();
                templateDescription.ID = string.Format("HD_Template_Description{0}", i.ToString());
                templateDescription.Rows = 3;
                templateDescription.TextMode = TextBoxMode.MultiLine;
                tc.Controls.Add(templateDescription);
                tr.Controls.Add(tc);

                // Hidden controls
                tc = new System.Web.UI.HtmlControls.HtmlTableCell();
                tc.Style.Add("display", "none");

                // The upload item type can be a template, a file, or a URL. This field is utilized by HotDocs 11 (and later). The
                // Upload plugin for HotDocs 10 does not set this field.
                HiddenField uploadItemType = new HiddenField();
                uploadItemType.ID = "HD_Template_UploadItemType" + i;
                tc.Controls.Add(uploadItemType);

                // Main Template File Name
                HiddenField templateMain = new HiddenField();
                templateMain.ID = "HD_Template_FileName" + i;
                tc.Controls.Add(templateMain);

                HiddenField libraryPath = new HiddenField();
                libraryPath.ID = "HD_Template_Library_Path" + i;
                tc.Controls.Add(libraryPath);

                HiddenField expirationDate = new HiddenField();
                expirationDate.ID = "HD_Template_Expiration_Date" + i;
                tc.Controls.Add(expirationDate);

                HiddenField expirationWarningDays = new HiddenField();
                expirationWarningDays.ID = "HD_Template_Warning_Days" + i;
                tc.Controls.Add(expirationWarningDays);

                HiddenField expirationExtensionDays = new HiddenField();
                expirationExtensionDays.ID = "HD_Template_Extension_Days" + i;
                tc.Controls.Add(expirationExtensionDays);

                HiddenField commandLineSwitches = new HiddenField();
                commandLineSwitches.ID = "HD_Template_CommandLineSwitches" + i;
                tc.Controls.Add(commandLineSwitches);

                // Template package file upload control
                FileUpload ulCtrl = new FileUpload();
                ulCtrl.ID = string.Format("HD_Upload{0}", i.ToString());
                tc.Controls.Add(ulCtrl);

                // Template manifest file upload control
                FileUpload ulPackageManifestXML = new FileUpload();
                ulPackageManifestXML.ID = string.Format("HD_Package_Manifest{0}", i.ToString());
                tc.Controls.Add(ulPackageManifestXML);

                tr.Controls.Add(tc);

                UploadedTemplatesGrid.Rows.Add(tr);
            }

//.........这里部分代码省略.........
开发者ID:MMetodiew,项目名称:hotdocs-open-sdk,代码行数:101,代码来源:Upload.aspx.cs


示例18: OnInit

    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);

        selectCurrency.Changed += (sender, args) => btnUpdate_Click1(null, null);

        // Add product button
        btnAddProduct = new CMSButton();
        btnAddProduct.Attributes["style"] = "display: none";
        Controls.Add(btnAddProduct);
        btnAddProduct.Click += btnAddProduct_Click;

        // Add the hidden fields for productId, quantity and product options
        hidProductID = new HiddenField { ID = "hidProductID" };
        Controls.Add(hidProductID);

        hidQuantity = new HiddenField { ID = "hidQuantity" };
        Controls.Add(hidQuantity);

        hidOptions = new HiddenField { ID = "hidOptions" };
        Controls.Add(hidOptions);
    }
开发者ID:arvind-web-developer,项目名称:csharp-projects-Jemena-Kentico-CMS,代码行数:22,代码来源:ShoppingCartContent.ascx.cs


示例19: GridView_LineInfo_RowDataBound

    protected void GridView_LineInfo_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            labRenShu = (Label)e.Row.FindControl("labRenShu");
            Label3 = (Label)e.Row.FindControl("Label3");
            Label5 = (Label)e.Row.FindControl("Label5");
            Label6 = (Label)e.Row.FindControl("Label6");
            string renshu = labRenShu.Text.Substring(0,labRenShu.Text.IndexOf("/"));
            renshunmu = Convert.ToDecimal(renshu.Split('+')[0]) + Convert.ToDecimal(renshu.Split('+')[1]);
            hf_Counter = (HiddenField)e.Row.FindControl("hf_Counter");
            if (hf_Counter.Value.Equals("1"))
            {
                e.Row.ForeColor = System.Drawing.Color.Green;
                e.Row.BackColor = System.Drawing.Color.White;
                e.Row.Font.Bold = true;
            }
            if (renshunmu > 0)
            {
               // Label6.Text = (Convert.ToDecimal(Label5.Text) / renshunmu).ToString("0.00");
            }
            else
            {
               // Label6.Text = "——";
            }

            Label7 = (Label)e.Row.FindControl("Label7");
            Label8 = (Label)e.Row.FindControl("Label8");
            if (!Label3.Text.Equals("") && !Convert.ToDecimal(Label3.Text).Equals(0))
            {
               // Label7.Text = (Convert.ToDecimal(Label5.Text) / Convert.ToDecimal(Label3.Text) * 100).ToString("0.00") + "%";
            }
            else
            {
                Label7.Text = "——";
            }
            if (Convert.ToDecimal(HFZongProfitTemp.Value) > 0)
            {
               // Label8.Text = (Convert.ToDecimal(Label5.Text) / Convert.ToDecimal(HFZongProfitTemp.Value) * 100).ToString("0.00") + "%";
            }
        }
        if (e.Row.RowType == DataControlRowType.Footer)
        {
            labRenShuF = (Label)e.Row.FindControl("labRenShuF");
            Label4F = (Label)e.Row.FindControl("Label4F");
            Label3F = (Label)e.Row.FindControl("Label3F");
            Label5F = (Label)e.Row.FindControl("Label5F");
            Label6F = (Label)e.Row.FindControl("Label6F");
            Label7F = (Label)e.Row.FindControl("Label7F");
            Label8F = (Label)e.Row.FindControl("Label8F");
            int adultnum = 0;
            int childnum = 0;
            decimal lb3 = 0;
            decimal lb4 = 0;
            decimal lb5 = 0;
            foreach (GridViewRow gr in GridView_LineInfo.Rows)
            {
                if (gr.RowType == DataControlRowType.DataRow)
                {
                    hf_Counter = (HiddenField)gr.FindControl("hf_Counter");
                    if (!hf_Counter.Value.Equals("1"))
                    {
                        labRenShu = (Label)gr.FindControl("labRenShu");
                        adultnum += Convert.ToInt32(labRenShu.Text.Substring(0, labRenShu.Text.IndexOf("+")));
                        childnum += Convert.ToInt32(labRenShu.Text.Substring(labRenShu.Text.IndexOf("+")).Replace("/2", ""));
                        lb4 += Convert.ToDecimal(((Label)gr.FindControl("Label4")).Text);
                        lb3 += Convert.ToDecimal(((Label)gr.FindControl("Label3")).Text);
                        lb5 += Convert.ToDecimal(((Label)gr.FindControl("Label5")).Text);
                    }
                }
            }
            labRenShuF.Text = adultnum + "+" + childnum + "/2";
            Label3F.Text = lb3.ToString("0.00");
            Label4F.Text = lb4.ToString("0.00");
            Label5F.Text = lb5.ToString("0.00");
            if ((adultnum + decimal.Parse(childnum.ToString()) / 2) > 0)
            {
                Label6F.Text = (lb5 / (adultnum + decimal.Parse(childnum.ToString()) / 2)).ToString("0.00");
            }
            if (lb3 > 0)
            {
                Label7F.Text = (lb5 / lb3 * 100).ToString("0.00") + "%";
            }
            if (Convert.ToDecimal(HFZongProfitTemp.Value) > 0)
            {
                Label8F.Text = (lb5 / Convert.ToDecimal(HFZongProfitTemp.Value) * 100) + "%";
            }
        }
    }
开发者ID:lemongeek,项目名称:MyGitHub,代码行数:89,代码来源:BL_XLLRAnalysis.aspx.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# HiddenMarkovClassifier类代码示例发布时间:2022-05-24
下一篇:
C# HiddenConditionalRandomField类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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