ListBox在绑定时只有TextField和ValueField,
我现在绑定了两个以上的字段【1】【2】【3】令TextField=【1】,ValueField=【2】
现有三个标签:Label1,2,3
把TextField的值赋给Label1,而Label2需要根据ValueField的值作为判断条件去赋值问题是Label3需要以字段【3】的值为条件去赋值,而怎样获得【3】的值呢?ListBox只提供TEXTField和ValueField啊
并且这个问题好像不是合并字段能解决的,我需要的仅仅是【3】单独的值。哪位高人有好的见解请赐教。
我现在绑定了两个以上的字段【1】【2】【3】令TextField=【1】,ValueField=【2】
现有三个标签:Label1,2,3
把TextField的值赋给Label1,而Label2需要根据ValueField的值作为判断条件去赋值问题是Label3需要以字段【3】的值为条件去赋值,而怎样获得【3】的值呢?ListBox只提供TEXTField和ValueField啊
并且这个问题好像不是合并字段能解决的,我需要的仅仅是【3】单独的值。哪位高人有好的见解请赐教。
解决方案 »
- 在子窗体给自已提交一次以后,给父窗体转值,
- 在线等高手讲解这样的功能是如何实现的,如果能有个实例那就更好了~在线等阿~~~
- Date.format函数
- 鼠标拖动的问题
- JS点击链接后过几秒打开网页
- 请问: 在ascx里面写javascript要用到页面上的某个控件,要怎么找到呢 ?我是用document.getElementID()但是好像找不到
- 请问大家这是什么意思
- JQUERY做表单验证,日期-时间验证问题!!
- 在页面a里javascript如何判断b页面是否输出完成(IE上地球已经停止转动)?
- 为什么调用函数的时候,被调用的函数中if会出现失效的情况
- 各位各位, Look Here! 请帮帮忙哦!!
- 時間格式問題
namespace testWebForm
{
public struct person
{
private string _name; public string Name
{
get { return _name; }
set { _name = value; }
} private int _age; public int Age
{
get { return _age; }
set { _age = value; }
} private string _jobTitle; public string JobTitle
{
get { return _jobTitle; }
set { _jobTitle = value; }
} public person(string name, int age, string jobTitle)
{
this._name = name;
this._age = age;
this._jobTitle = jobTitle;
} } public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
List<person> collection = new List<person>();
ListItem item = null;
collection.Add(new person("name1",1,"asp.net"));
collection.Add(new person("name2",2,"js"));
for (int i = 0; i < collection.Count; i++)
{
item = new ListItem(collection[i].Name,collection[i].Age.ToString());
item.Attributes.Add("title", collection[i].JobTitle);
ls.Items.Add(item);
}
}
}
}
}
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
<script type="text/javascript"> function clickHandler()
{
var ls = document.getElementById("ls");
if (ls.selectedIndex > -1)
{
window.alert(ls.options[ls.selectedIndex].title);
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ListBox ID="ls" runat="server">
</asp:ListBox>
<input type="button" onclick="clickHandler()" value="test" />
</div>
</form>
</body>
</html>
<asp:ListBox ID="ListBox1" runat="server" DataSourceID="SqlDataSource1" DataTextField="Category" DataValueField="EvalType" Height="260px" Width="426px" BackColor="#e6e6fa"></asp:ListBox>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:EvaluationConnectionString %>" SelectCommand="SELECT [Category],[DefaultValue] ,[EvalType] FROM [Rules4PM] where ItemID like '0202010%'"></asp:SqlDataSource>能通过js代码获取TextField 和ValueField的值将其赋给相应标签,
问题是怎样单独获取第三个值EvalType(int型),我要以它的值为条件进行后面的操作。
不知我说清楚没有,还请高人多费耐心,小弟是新手。