本文介绍了带中继器的数学的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用中继器控件创建了动态文本框
现在我需要一些数学帮助.
它将添加第一个金额框,然后添加第二个,但之后将停止

我需要在中继器中添加任何新框创建,感谢所有帮助.
:〜


I created a dynamic Text Boxes using repeater controls
now I need help in doing some math.
It add the first amount box and the second but after it stops

I need for it add any new box create in the repeater all help is appreciated.
:~


private void addallmbe()
             {
                 int totalamount = 0;
                 int subamount = 0;
                 int answers;
                 if (Amount.Text != "")
                 {
                      if(MBE.Text == "Yes")

                      {
                     foreach (RepeaterItem item in Repeater1.Items)
                     {


                     string amount = ((TextBox)item.FindControl("txtAmount")).Text;
                     totalamount = int.Parse(Amount.Text);
                     subamount = totalamount + int.Parse(amount.ToString());
                     subamount = subamount + int.Parse(amount.ToString());

                     }


                     answers = totalamount + subamount;
                     MBEAmount.Text = answers.ToString();
                     //answers.ToString(MBEAmount.Text.ToString());
                    }
                 }
             }


:〜

推荐答案

subamount = totalamount + int.Parse(amount.ToString());


感谢您的回复.

:)


Thanks for responding.

:)



这篇关于带中继器的数学的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-25 01:14