在源代码中创建文本框 [英] create textbox in source code

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

问题描述

如何在asp.net中的源代码中创建文本框

how can i create textbox in source code in asp.net

推荐答案

TextBox myTxtBox = new TextBox();
myTxtBox.ID = "myTextBoxCreatedInCode";



现在,请选择一本书.首先阅读,然后尝试编码!!!



Now, pick a book please. Read first and then try coding!!!


您好,
我在单击按钮时添加了一个TextBox.

她的代码在Windows中
Hello,
I have added a TextBox on the click of a button

hers the code in windows
private void button1_Click(object sender, EventArgs e)
        {
//create object of textbox class
            TextBox t1 = new TextBox();
//setting the name
             t1.Name = "textbox1";
//setting the text property 
            t1.Text = "Radix";
//setting the location where the control will be placed
            t1.Location = new Point(139, 131); 
//adding new control  
            this.Controls.Add(t1);
        }



ASP.NET不包含Location属性,因此在ASP.NET中进行编码时,只需注释位置行即可.

一旦找到有用的答案,就对我的答案进行评分

谢谢&问候
基数:)



ASP.NET does not contain the Location property, so while coding in ASP.NET just comment the location line and you are done

Do Rate my answer once you find it useful

Thanks & Regards
Radix :)


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

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