日期:2014-05-17  浏览次数:20723 次

新手求助!!!页面间传值问题~
我想实现这样一功能求教!!
两页面:web1,web2;
web1中一Gridview控件:列Id,Name,Button按钮;

<asp:Button ID="Buttonid" runat="server" Text="ID" OnClientClick="return vv()"/>

function vv() 
  {  
  var result=showModalDialog('RepleDetailed.aspx','RepleDetailed','dialogWidth:500px;dialogHeight:400px;center:yes;help:no;resizable:no;status:no');  
  } 

点击按钮跳到网页对话框web2并传以Gridview列的Id值;
web2接收Id








------解决方案--------------------
C# code

<asp:Button ID="Buttonid" runat="server" Text="ID" OnClientClick='vv(<%#Eval("id")%>)'/>


function vv(val)  
  {   
  var result=showModalDialog('RepleDetailed.aspx?id='+val,'RepleDetailed','dialogWidth:500px;dialogHeight:400px;center:yes;help:no;resizable:no;status:no');   
  }

------解决方案--------------------
querystring
------解决方案--------------------
C# code


function vv(id) {
            var str = window.showModalDialog("RepleDetailed.aspx?id="+id+"&tmp="+new Date()+"", "RepleDetailed", "dialogWidth:500px;dialogHeight:400px;center:yes;help:no;resizable:no;status:no");
        }

<a href="#" onclick='vv(<%#Eval("ID") %>)'>查看</a>