咨询,就免费赠送域名与服务器,咨询热线:18923197528当前位置: 主页 > 网站优化 > SEO技术 >
推荐内容
联系我们
QQ:835763446
电话咨询:18923197528
E-mail:1261182346@qq.com
地址:佛山市禅城区江湾三路28号 佛山软件产业园8号楼6楼

response.redirect使用技巧,response.redirect用法详解

文章来源:http://www.fsyiteng.cn 文章作者:佛山SEO/网站建设 2019-07-27

response.redirect使用,response.redirect用法详解,佛山网站优化小编为你整理分享response.redirect用法详解


    The Redirect method causes the browser to redirect the client to adifferent URL.
 
EG:
 
   string CurrentTime = DateTime.Now.ToShortDateString().ToString();
 
   //其中UserId是从函数外传递进去的参数,注意超链接需要添加引号,引号内的东西原样输出
 
   string MyUrl = "http://www.microsoft.com?UID=" + UserId + "&TYPE &APP&BIZ=" + CurrentTime + "&func=SYS0102";
 
   Response.Redirect(MyUrl);
 
小注:区别往sql语句中传递变量是这种形式'"+CurrentTime+"',而拼接字符串时变量" + CurrentTime + "其中CurrentTime前后的++表示连接,而+前或后的"是对其前后需要连接的字符串用的。
 
对数据库里面的SQL语句赋值的时候也要用在双引号里面SQL="select a,b,c from ..."
 
但是SQL语句中会有单引号把字段名引出来
 
例如:select * from table where user='abc';
 
这里的SQL语句可以直接写成SQL="select * from table where user='abc’"
 
ANSI/ISO标准规定字符数据的SQL常量要包含在单引号(')内。
--------------------- 
 



 
response.redirect使用,response.redirect用法详解,佛山网站优化小编为你整理分享response.redirect用法详解