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();
    }

  • 相关阅读:
    php intval()函数
    MVC开发模式
    Session详解
    JSP入门
    Response中文乱码问题
    cookie入门
    idea实现更改servlet模板
    使用new和newInstance()创建类的区别
    Servlet 3.0 新特性详解
    web Servlet 3.0 新特性之web模块化编程,web-fragment.xml编写及打jar包
  • 原文地址:https://www.cnblogs.com/hjhd/p/2980589.html
Copyright © 2011-2022 走看看