• .net控件


    当你使用服务器控件,在repeater中放入服务器控件时designer.cs文件中怎么都不会出现你拖拉的控件时,对于新手的我来说很麻烦

    现在使用后台的方法暂时实现功能,具体代码如下:

    protected void Button2_Click(object sender, EventArgs e)
    {
     foreach (RepeaterItem item in repConParList.Items) //repeater控件
     {
     Label lblId = (Label)item.FindControl("lblId");
     string id = lblId.Text;
    System.Web.UI.HtmlControls.HtmlSelect sel_type = (System.Web.UI.HtmlControls.HtmlSelect)item.FindControl("sel_type"); 
     System.Web.UI.HtmlControls.HtmlInputText txt_ReceiveGift = (System.Web.UI.HtmlControls.HtmlInputText)item.FindControl("txt_ReceiveGift");
     System.Web.UI.HtmlControls.HtmlInputCheckBox cbReceive = (System.Web.UI.HtmlControls.HtmlInputCheckBox)item.FindControl("cbReceive"); 
     System.Web.UI.HtmlControls.HtmlInputCheckBox cbReceived = (System.Web.UI.HtmlControls.HtmlInputCheckBox)item.FindControl("cbReceived");  System.Web.UI.HtmlControls.HtmlInputText txt_Receipt = (System.Web.UI.HtmlControls.HtmlInputText)item.FindControl("txt_Receipt"); 
     System.Web.UI.HtmlControls.HtmlInputText txt_Invoice = (System.Web.UI.HtmlControls.HtmlInputText)item.FindControl("txt_Invoice"); 
     Label lblusername = (Label)item.FindControl("lblusername");
     Parkingfeemodel = new Model.ParkingFee();
     Parkingfeemodel.MoneyType = sel_type.SelectedIndex.ToString();
     string n = txt_ReceiveGift.Value;
     Parkingfeemodel.ReceiveGift = int.Parse(n);

    Parkingfeemodel.Receive =1;

     Parkingfeemodel.Received = 1;
     string i = txt_Receipt.Value;
     Parkingfeemodel.Receipt = int.Parse(i);
     string t = txt_Invoice.Value;
     Parkingfeemodel.Invoice = int.Parse(t);
     lblusername.Text = SessionInfo.User.UserName;
     Parkingfeemodel.TransferName = lblusername.Text;
     Parkingfeemodel.Id = int.Parse(id);
     parkingfeeservice.UpdateParkingFee(Parkingfeemodel);
     }
     Bind();
    }

  • 相关阅读:
    IO多路复用--epoll(待学习)
    网络信息检索
    TCP协议的客户端与服务器的通信过程
    UDP网络编程
    HDU_oj_2017 字符串统计
    HDU_oj_2016 数据的交换输出
    HDU_oj_2015 偶数求和
    HDU_oj_2014 评委会打分
    HDU_oj_2013 蟠桃记
    HDU_oj_2012 素数判定
  • 原文地址:https://www.cnblogs.com/hjhd/p/2980589.html
Copyright © 2020-2023  润新知