天天看点

Response.Redirect用法详解

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常量要包含在单引号(')内。