主题:一个局部变量的问题
各位帮忙看一下:
<%
string a;
string strConn = ConfigurationManager.ConnectionStrings["517517ConnectionString"].ConnectionString;
string shopid, itype, intro,bbsid, topimg,sname1;
SqlConnection myConn = new SqlConnection(strConn);
int i = 0;
sname1 = Request.QueryString["sname"];
shopid = Request.QueryString["id"];
itype = Request.QueryString["itype"];
if (shopid == null) shopid = "-1";
if (itype == null) itype = "0";
if (sname1 == null) sname1 = "无";
%>
<script language="javascript">
document.title=<%=sname1%>
</script>
如果是这样的话就是一个错误的.
但是如果把sname1改成itype 或者shopid都是可以的,如果再增加一个变量
string a;
a="asdfsadf"
然后把sname1替换成a这样也不可以.
想问一下各位,怎么样解决这个问题
<%
string a;
string strConn = ConfigurationManager.ConnectionStrings["517517ConnectionString"].ConnectionString;
string shopid, itype, intro,bbsid, topimg,sname1;
SqlConnection myConn = new SqlConnection(strConn);
int i = 0;
sname1 = Request.QueryString["sname"];
shopid = Request.QueryString["id"];
itype = Request.QueryString["itype"];
if (shopid == null) shopid = "-1";
if (itype == null) itype = "0";
if (sname1 == null) sname1 = "无";
%>
<script language="javascript">
document.title=<%=sname1%>
</script>
如果是这样的话就是一个错误的.
但是如果把sname1改成itype 或者shopid都是可以的,如果再增加一个变量
string a;
a="asdfsadf"
然后把sname1替换成a这样也不可以.
想问一下各位,怎么样解决这个问题