如何在asp.net的datagrid中将文本与数据库值绑定 [英] How to bind Text with database value in datagrid in asp.net
本文介绍了如何在asp.net的datagrid中将文本与数据库值绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好
我想在绑定到datrgrid中的feild模板中时在数据库值中附加文本..
Bind("Databasefeild")
它正在运行
但我要
一些文本+ Bind("Databasefeild")
我该怎么办?
请帮帮我吗?
Hello
I wants to append text with database value at time of binding in template feild in datrgrid ..
Bind("Databasefeild")
It is running
but I wants
Some text + Bind("Databasefeild")
How Will I do ?
Please help me ?
推荐答案
您可以使用以下代码进行操作:
< asp:label name ="SS" text =<%#GetAppendedText(Bind(" databasefeild =))%>" .. =" xmlns:asp =#unknown">
并在后面的代码中:
Hi,
You can do using this code:
<asp:label name="SS" text="<%# GetAppendedText(Bind(" databasefeild=")) %>" ..="" xmlns:asp="#unknown">
and in your code behind:
public string GetAppendedText(string Databasefeild)
{
//TODO write code to return your string
//append text or edit value and then send it back
}
希望对您有所帮助,
干杯
I hope it will help,
Cheers
这篇关于如何在asp.net的datagrid中将文本与数据库值绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文