如何将值多个texbox存储到表中? [英] How to store value multiple texboxes to a table?

查看:125
本文介绍了如何将值多个texbox存储到表中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想一次将多个txtbox值插入到表中.当我将值存储到将存储在表中的所有文本框中时. 此处文本框是自动创建的

监视我的代码:

Hi,

I want to insert the multiple txtbox values to a table single time. When I will store the values to all textboxes that will store in table. Here textboxes are automatic created

Lookout my code:

protected void cmdCreate0_Click(object sender, EventArgs e)
   {

       table1.Controls.Clear();
       int rows = Int32.Parse(txtRows.Text);
       int cols = Int32.Parse(txtCols.Text);
       for (int row = 0; row < rows; row++)
       {

           TableRow rowNew = new TableRow();

           table1.Controls.Add(rowNew);
           for (int col = 0; col < cols; col++)
           {

               TableCell cellNew = new TableCell();
               TextBox txtContent = new TextBox();

               cellNew.Controls.Add(txtContent);

               if (chkBorder.Checked)
               {
                   cellNew.BorderStyle = BorderStyle.Inset;
                   cellNew.BorderWidth = Unit.Pixel(1);
               }

               rowNew.Controls.Add(cellNew);
           }
       }
   }

推荐答案

您能解释一下您想做什么吗?
can u explain more what u want to do?


这篇关于如何将值多个texbox存储到表中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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