Click here to Skip to main content
15,905,148 members
Please Sign up or sign in to vote.
2.00/5 (4 votes)
See more:
In the button click event, I want to get the cell value in dynamic table
and then calculate the value and insert it into the database.

Code below.
C#
protected void btnCalc_Click(object sender, EventArgs e)
        {
            Table tblnew = new Table();
            //foreach (Control c in this.form1.Controls)
            //{
                            if (Request.Form["txt" + a] != null)
                            {
                                 txta =Convert.ToInt32(Request.Form["txt" + a]);
                                a = a + 1;
                                //break;
                            }
                            if (Request.Form["txtExR1"] != null)
                            {
                                 txtex = Convert.ToInt32(Request.Form["txtExR1"]);
                                 //Request.Form["col24"].Replace("",inr);
                            }
                            if (Request.Form["lbl24"] != null)
                            {
                             string ss=   Request.Form["lbl24"].Insert(0, "econ");
                            }
                            if (Request.Form["col24"] != null)
                            {
                                Request.Form["col24"].Insert(0, "econ");
                            }
                                 //l.Text = inr;
                            string usd = (txta * Convert.ToInt32(lblq1.Text)).ToString();
                            string cal = (txta * txtex).ToString();

                            lctxt.Value = cal;
                            //dpnl.Visible = true;


            //}
            dpnl.Visible = true;
            cnt = 0;
           // chk();
            Invoice_Report();
            Panel1.Visible = false;
            btnchrg.Visible = true;
            btnCalc.Visible = true;
Posted
Updated 14-Apr-11 19:09pm
v2
Comments
Sergey Alexandrovich Kryukov 15-Apr-11 0:56am    
Where is your question? Any effort?
--SA
prashantjshirsat 15-Apr-11 1:05am    
[This long code should be in Question]
In comments it's hard to read.
Ankur\m/ 15-Apr-11 2:16am    
This seems ASP.NET to me.
In ASP.NET use GridView (or other CompositeDataBoundControl) to create a dynamic table.

1 solution

I Did't Get
Use For Loop To Read Values From Dynamic Table With In Loop Add All Values Store in appropriate type
After that Store It To Database
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900