stroing运行时将contorls数据添加到asp.net中的数据库中 [英] stroing the runtime added contorls data into database in asp.net

查看:75
本文介绍了stroing运行时将contorls数据添加到asp.net中的数据库中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在运行时在asp.net中创建了一个TextBox控件我希望在我的程序中使用该控件数据并且我想将它存储在数据库中我该怎么做呢

TextBox t = new TextBox ();

Form1.Controls.Add(t);

t.Id =txtBox;

I Created a TextBox Control in asp.net at run time i want use that control data in my program and i want store it in data base how can i do this
TextBox t=new TextBox();
Form1.Controls.Add(t);
t.Id="txtBox";

推荐答案

在Button Click事件中尝试此操作:

Try this in Button Click event:
public void button_click(object sender, EventArgs e)
{
 TextBox txt = (TextBox)form1.FindControl("txtBox");
  var x = t.Text
 }


这篇关于stroing运行时将contorls数据添加到asp.net中的数据库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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