清除文本框的文本 [英] clears the text of textbox

查看:82
本文介绍了清除文本框的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么在单击按钮时中继器中的文本框会清除输入的文本?

OP的更新:

Why did the textbox in repeater clear the text which I enter into it as I click the button?

UPDATE from OP:

protected void Submit_Click(object sender, EventArgs e)
    {
        BillOfQuantitiesObj = new BillOfQuantitiesBAO();
        foreach (RepeaterItem rr in Repeater1.Items)
        {
            BillOfQuantitiesObj.ContRegNo = ContRegNo;
            BillOfQuantitiesObj.TenderNo = TenderNo;
            BillOfQuantitiesObj.TenderSNo = TenderSNo;
            BillOfQuantitiesObj.Items = ((Label)rr.FindControl("LbItem")).Text;
            BillOfQuantitiesObj.Description = ((Label)rr.FindControl("LbDescription")).Text;
            BillOfQuantitiesObj.Unit = ((Label)rr.FindControl("LbUnit")).Text;
            BillOfQuantitiesObj.Quantity = decimal.Parse(((TextBox)rr.FindControl("LbQuantity")).Text);
           BillOfQuantitiesObj.RateInNumbers = decimal.Parse(((TextBox)rr.FindControl("RateInNumbersTB")).Text);
            BillOfQuantitiesObj.RateInfigures = ((TextBox)rr.FindControl("RateInFiguresTB")).Text;
           BillOfQuantitiesObj.TotalAmount =decimal.Parse(((TextBox)rr.FindControl("TotalAmountTB")).Text);
        ContractorBillOfQuantitiesDAO.InsertBillOfQuantities(BillOfQuantitiesObj);
            }
    }


在最后三个文本框中,它们的值在运行时输入.

感谢


It is in last three textboxs whose value is entered at runtime.

thanks

推荐答案

在没有看到代码的情况下无法回答这个问题.
请提供!

这将使人们能够做出全面的回应.

但是...
拨打电话时,您是否将其重置为空?
您要重新初始化吗?
您如何处理先前输入的数据?

马上有不同的可能答案,所以您明白了为什么代码很重要.
There is no way of answering this without seeing the code.
Please Provide It!

This will enable people to give a full response.

However...
When you do the call are you resetting it null?
Are you reinitialising it?
How are you handling the previously entered Data?

Straight away there are different possible answers, so you see why the code is important.


Textbox.text = string.empty;


我怀疑您的绑定已完成,但根据您提供的代码是不可能的.
I suspect that your binding is hosed up, but it''s impossible to tell based on the code that you''ve provided.


这篇关于清除文本框的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆