在asp中调用文本框 [英] Calling a textbox in asp

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

问题描述

大家好,



i在aspx页面中有这个文本框:



< tbody>
< asp:TextBox ID = fname_txt runat =server>




i尝试通过页面名称调用文本框它没有工作如何从我在vb.net中创建的类中调用此文本框?



谢谢:)

hi all,

i have this textbox in a aspx page:

<asp:TextBox ID=fname_txt runat="server" >


i tried to call the textbox by the page name it did not work so how can i call this textbox from a class that i created in vb.net?

thank you :)

推荐答案

使用其ID调用TextBox。



主要在TextBoxes中我们需要获取/设置数据。



所以在代码behid文件(.aspx.vb)中你可以用ID调用它,例如



将数据变暗为字符串

data = fname_txt.Text



now将data变量传递给另一个类
Call your TextBox with its ID.

Mostly in TextBoxes we need to get/set Data.

so in the code behid file (.aspx.vb) you can call it with ID e.g.

Dim data as String
data= fname_txt.Text

now pass the "data" variable to another class


我将变量声明为public并且数据变量仍然无法从类中访问:(
I declared the variable as public and the data variable is still inaccessible from the class :(


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

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