是这样的,在生成JS脚本后,并把它嵌套到所需要的统计页面!
一个参数是这样的:
<script language=javascript src='http://localhost/hao/reg/usercount/Counter/counterAdd.aspx?id=88'></script>
两个参数是这样的:
<script language=javascript src='http://localhost/calyx/reg/usercount/Counter/counterAdd.aspx?id=88&Config=1' ></script>在counterAdd.aspx.cs中,写入每访问一次统计页面就增加1,代码如下:
private void Page_Load()
{
if(!IsPostBack)
{
int temp = -1;
temp = int.Parse(Request.Params["id"].ToString());
if(Request.QueryString.Count==1)
{
//在usercount表的count列增加1
}
else
{
//在userContainCount表的SiteCount列增加1
}
}
}
为啥请求两个参数时,只执行else{}里头的语句。而请求一个参数时,却没有反应!
一个参数是这样的:
<script language=javascript src='http://localhost/hao/reg/usercount/Counter/counterAdd.aspx?id=88'></script>
两个参数是这样的:
<script language=javascript src='http://localhost/calyx/reg/usercount/Counter/counterAdd.aspx?id=88&Config=1' ></script>在counterAdd.aspx.cs中,写入每访问一次统计页面就增加1,代码如下:
private void Page_Load()
{
if(!IsPostBack)
{
int temp = -1;
temp = int.Parse(Request.Params["id"].ToString());
if(Request.QueryString.Count==1)
{
//在usercount表的count列增加1
}
else
{
//在userContainCount表的SiteCount列增加1
}
}
}
为啥请求两个参数时,只执行else{}里头的语句。而请求一个参数时,却没有反应!
{
}
else//不是一个参数时
{
}
您的写法跟我一样的啊!
if(Request.QueryString.Count==1)
{
//在usercount表的count列增加1
}
但我的代码里头没有。而请求两个参数,是正确的!为何呢?