传值的体会,Session 页面1,页面2, -----》页面1里把值赋给session.比如 session["id"]=this.labe1.tex.页面2接受时也要用Session 接受, 比如用一个变量来接收.string a=session["id"].tostring();
Request.QueryString[" id"]------>>页面1里有数据源控件Reapter1需要绑定一个详细信息并且把页面1其中一个字段的ID传递到页面2. 页面1里这样 <a href="Default2.aspx?id=<%#Eval("id")%>">详细信息></a>
页面2里这样接收 string a=Request.QueryString["id"].Tostring();
这个弹出页面是在服务器端。
把html的值以弹出页面的形式传递。 LindButton.Attributes.Add("onclick",window.open(' http://www.cnblogs.com/page/AfterService/pageInpute.aspx?CustomerName="+Server.UrlEncode(this.textbox1.text.Trim())+"&phone="+Server.UrlEncode(this.TextBox2.text.Trim())+" ',ShowMediaInfo','dialogHeight:600px;dialogWidth:640px;center:yes;help:no;resizable:no;status:no;')");
页面2接收值
if(Request.Querystring["CustomerName"]!=null&&Request.QueryString["CustomerName"].tostring()!=string.Empty)
{
string b =Server.HtmlDecode(Request.QueryString["CustomerName"].Trim());
}
下面弹出页面是在客户端
<script>
function OpenHtml(url)
{
window.open("http://www.cnblogs.com/htm/"+url,"Details");
}
</script>
这个htm是我在根目录下第二级新建的文件夹htm.
怎么绑定数据里的一个文件名呢,
<a href ="javascript:OpenHtml('<%# Eval("Rou") %>');"> 查看巡检记录表</a>
第三个
function ShowMidiaInfo(pid)
{
window.showModalDialog('../AfterService/QueryDataDetail.aspx?id='+pid,'ShowMediaInfo','dialogHeight:600px;dialogWidth:800px;center:yes;help:no;resizable:no;status:no;');
}
调用
<a href ="javascript:ShowMidiaInfo('<%# Eval("PollerID")%>')"><%# GetNoteName(Convert.ToString(Eval("St"))) %></a>
</td>