asp.net中的文本框值 [英] text box values in asp.net

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

问题描述

你好所有

i有查询select id,name from table

i需要把名字放在文本和id中但id隐藏了,我需要编程

hello all
i have query "select id,name from table"
i need put the name in the text and id too but the id hidden, i need it programming

推荐答案

请看这里: ASP.NET隐藏字段 [ ^ ]


在您的案例中使用隐藏字段



我不知道你正在使用什么方法,但这可能对你有所帮助



如果你已经使用过这个表格那么就这样做了



Use hidden field in your case

I dont know what approach you are using but this may help you

if you have used the form then do like this

<asp:hiddenfield id="dsdfsdf" value="your id value" xmlns:asp="#unknown" />
<asp:textbox text="textvalue" mode="hold" xmlns:asp="#unknown" />





如果你正在使用gridview,那么你可以在模板中做同样的事情字段使用隐藏字段





问候....:)



If you are using gridview then same thing you can do in template field used hidden fields


regards....:)


你可以使用id不使用隐藏字段...当您在数据集中检索数据时,将数据集放入会话中,并根据条件从textchanged检索数据集中的数据...

例如。



dataset ds = new dataset();

ds = filldataset的方法(在页面加载时)..

session [ds] = ds;



然后on textchanged

电话..

int id = session [ds]。选择(你的查询)..(它返回datarow然后使用foreach循环找到特定列...)



:)
You Can use id without using hidden field...when you retrieve data in dataset put dataset in session and on textchanged retrieve data from dataset according to condition...
eg.

dataset ds=new dataset();
ds=your method to filldataset(on page load)..
session["ds"]=ds;

then on textchanged
call..
int id=session["ds"].select(your query)..(it returns datarow then use foreach loop to find particular column...)

:)


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

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