一aspx页有如下代码,后面带个参数,例如:aabb.aspx?username=SSSS
aabb.aspx页面代码
<%@ Page Language="C#" ContentType="text/html" ResponseEncoding="gb2312" Debug="true"%>
<%@ Import Namespace="System"%>
<%@ Import Namespace="System.Web.UI.WebControls"%>
<%@ Import Namespace="System.Web.UI.HtmlControls"%>
<%@ Import Namespace="System.Web.Security " %>
<%@ Import Namespace="System.Web.Security " %>
<%@ Import Namespace="System.Web.Security " %><script runat="server">
protected void Page_Load(Object Src, EventArgs E)
{
}
public string GetYonghu()
{
string yonghu = string.Empty;
yonghu=Request.QueryString["username"];
return yonghu;
}
</script><form id="Form1" method="post" runat="server">
<%GetYonghu();%>
</form>获取后<%GetYonghu();%>却是这空的(页面空白,SSSS没有显示出来),没有值。求解。。
aabb.aspx页面代码
<%@ Page Language="C#" ContentType="text/html" ResponseEncoding="gb2312" Debug="true"%>
<%@ Import Namespace="System"%>
<%@ Import Namespace="System.Web.UI.WebControls"%>
<%@ Import Namespace="System.Web.UI.HtmlControls"%>
<%@ Import Namespace="System.Web.Security " %>
<%@ Import Namespace="System.Web.Security " %>
<%@ Import Namespace="System.Web.Security " %><script runat="server">
protected void Page_Load(Object Src, EventArgs E)
{
}
public string GetYonghu()
{
string yonghu = string.Empty;
yonghu=Request.QueryString["username"];
return yonghu;
}
</script><form id="Form1" method="post" runat="server">
<%GetYonghu();%>
</form>获取后<%GetYonghu();%>却是这空的(页面空白,SSSS没有显示出来),没有值。求解。。
protected void Page_Load(Object Src, EventArgs E)
{
Response.Write Request.QueryString["username"];
}
行 21: <form id="Form1" method="post" runat="server">
行 22: <%=GetYonghu();%>
行 23: </form>
行 24:
源文件: F:\视频售楼\Video_sell\temp.aspx 行: 22
行 16: {
行 17: Response.Write Request.QueryString["username"];
行 18: }
行 19: public string GetYonghu()
源文件: temp.aspx 行: 17 ________________________________________
不用写成函数,就直接获取试试是什么原因。
protected void Page_Load(Object Src, EventArgs E)
{
Response.Write Request.QueryString["username"];
}
request.parms[]================12345,上山打老虎
<%@ Import Namespace="System"%>
<%@ Import Namespace="System.Web.UI.WebControls"%>
<%@ Import Namespace="System.Web.UI.HtmlControls"%>
<%@ Import Namespace="System.Web.Security " %><script runat="server">
protected void Page_Load(Object Src, EventArgs E)
{
}
public string GetYonghu()
{
string yonghu = string.Empty;
yonghu=Request.QueryString["username"];
return yonghu;
}
</script><form id="Form1" method="post" runat="server">
<%Response.Write(GetYonghu());%>
</form>