zoukankan      html  css  js  c++  java
  • .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();
    }

  • 相关阅读:
    MySql中的变量定义
    mysql常用脚本
    Spring中依赖注入的使用和配置
    在linux下通过sh运行java程序
    linux下shell脚本学习
    eclipse导出jar包
    mysql中游标的使用
    netty中LengthFieldBasedFrameDecoder的使用
    网络游戏服务器架构(转)
    H2 database的使用
  • 原文地址:https://www.cnblogs.com/hjhd/p/2980589.html
Copyright © 2011-2022 走看看