我有一页面a.aspx中有段js代码
<script>
function showDetail(obj)
{
............
window.parent.frames("frmbottom").window.location= "b.aspx?cid=" + obj.EmpID
window.parent.frames("frmbottom").window.document.form1.cid.value = obj.EmpID
....................
</script>
-------------------------
类文件a.aspx.vb中
在DataGrid_ItemDataBound事件中
Dim EmpID= e.Item.Cells(0).Text
e.Item.Attributes.Add("onclick", "showDetail(this)")但是运行是总说我“列名 'undefined' 无效”,同时我看到我的地址栏中是b.aspx?cid=undefined,说明我的参数没有生效。
<script>
function showDetail(obj)
{
............
window.parent.frames("frmbottom").window.location= "b.aspx?cid=" + obj.EmpID
window.parent.frames("frmbottom").window.document.form1.cid.value = obj.EmpID
....................
</script>
-------------------------
类文件a.aspx.vb中
在DataGrid_ItemDataBound事件中
Dim EmpID= e.Item.Cells(0).Text
e.Item.Attributes.Add("onclick", "showDetail(this)")但是运行是总说我“列名 'undefined' 无效”,同时我看到我的地址栏中是b.aspx?cid=undefined,说明我的参数没有生效。
string EmpID = .....
e.Item.Attributes.Add("onclick", "showDetail("+EmpID +")")
jsfunction showDetail(obj)
{
............
window.parent.frames("frmbottom").window.location= "b.aspx?cid=" + obj
window.parent.frames("frmbottom").window.document.form1.cid.value = obj
<script language="javascript">
function showDetail(obj)
{
URL = window.parent.frames("frmbottom").window.location.href
if(URL.indexOf("equipment_list.aspx")==-1){
window.parent.frames("frmbottom").window.location = "b.aspx?cid=" + obj + "&PageType=Base"
return
}
window.parent.frames("frmbottom").window.document.form1.cid.value = obj
strUrl=window.parent.frames("frmbottom").window.frames("main").location.href
NewUrl = strUrl.substr(0,strUrl.indexOf("?")) + "?cid="+obj+ "&PageType=Base"
window.parent.frames("frmbottom").window.frames("main").location.href = NewUrl
}
</script>
a.aspx.vb中
在MyDataGrid1_ItemDataBound事件下
If e.Item.ItemIndex >= 0 Then
Dim EmpID As String = e.Item.Cells(0).Text
e.Item.Attributes.Add("onclick", "showDetail(" + EmpID + ")")
End If
b.aspx客户端中
<input type="hidden" name="cid" value="<%=request.querystring("cid")%>">
b.aspx.vb中
Page_Load时间下
Dim locationsrc As String
If Request.QueryString("PageType") = "base" Then locationsrc = "c.aspx?cid=" & Request.QueryString("cid") & "&pagetype=" & Request.QueryString("PageType")
myiframe.Attributes.Add("src", locationsrc)但是现在的问题是b.aspx中的cid隐藏域无法获取a.aspx中的cid值