如何获取嵌套在Repeater1和Repeater2里面的文本框的值

 我来答
似安彤0hk
2016-07-19 · TA获得超过119个赞
知道小有建树答主
回答量:219
采纳率:0%
帮助的人:317万
展开全部
//后台获取
protected void btnPay_Click(object sender, EventArgs e)
{
if (rptMest.Items.Count > 0)
{

List<Model.Pay> listPayModel = new List<Model.Pay>();
foreach (RepeaterItem rptitem in this.rptMest.Items)
{
payModel = new Model.Pay();
HiddenField hfID = (HiddenField)rptitem.FindControl("hfID");
Label lblFee = rptitem.FindControl("lblFee") as Label;
TextBox txtPayment = rptitem.FindControl("txtPayment") as TextBox;
TextBox txtNotes = rptitem.FindControl("txtNotes") as TextBox;
TextBox txtPayDate = rptitem.FindControl("txtPayDate") as TextBox;
payModel.OperatingDate = Convert.ToDateTime(txtPayDate.Text);
payModel.Fee = Convert.ToInt32(lblFee.Text);
payModel.ManifestID = hfID.Value;
payModel.CreateUser = CurrentUser.ID;
payModel.OperatingUser = CurrentUser.ID;
payModel.Remark = "";
payModel.Payment = Convert.ToInt32(txtPayment.Text);
listPayModel.Add(payModel);
}
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式