<asp:HyperLinkColumn DataNavigateUrlField="URL" DataNavigateUrlFormatString="vbscript:selectitem("{0}")" DataTextField="NAME">aspx.vb中的代码:
{
Dim List As New ArrayList
Dim data As HData(HData是一个自定义的类)
Dim reader As SqlDataReader
While reader.Read
data = New HakkosyaData
data.CODE = reader.Item(0).ToString
data.NAME = reader.Item(1).ToString
data.ID = reader.Item(7).ToString
data.URL = "" & reader.Item(7) & """,""" & reader.Item(1) & ""
List.Add(data)
End While
DataGrid1.DataSource = data}<script language="vbscript">
Function selectitem(code,name)
window.opener.document.form1.sinseisyaID.value = code
window.opener.document.getElementById("sinseiName").innerText = name
window.parent.focus
window.close
End Function
</script>这里面的selectitem("{0}")里面的参数不明白什么现在这个程序已经运行起来了 没有问题。但是{0}什么意思呢 为什么做了这个声明以后明明客户端是需要2个参数的 怎么用selectitem("{0}")这个就可以搞定了呢?
{
Dim List As New ArrayList
Dim data As HData(HData是一个自定义的类)
Dim reader As SqlDataReader
While reader.Read
data = New HakkosyaData
data.CODE = reader.Item(0).ToString
data.NAME = reader.Item(1).ToString
data.ID = reader.Item(7).ToString
data.URL = "" & reader.Item(7) & """,""" & reader.Item(1) & ""
List.Add(data)
End While
DataGrid1.DataSource = data}<script language="vbscript">
Function selectitem(code,name)
window.opener.document.form1.sinseisyaID.value = code
window.opener.document.getElementById("sinseiName").innerText = name
window.parent.focus
window.close
End Function
</script>这里面的selectitem("{0}")里面的参数不明白什么现在这个程序已经运行起来了 没有问题。但是{0}什么意思呢 为什么做了这个声明以后明明客户端是需要2个参数的 怎么用selectitem("{0}")这个就可以搞定了呢?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货