我想传递URL,我的代码是:
MyUrl = "http://www.abc.co.in/Download.aspx?period=" + Server.UrlEncode
(DateTime.Now.ToString("dd-MMM-yyyy")) + "&ProductName="
+ Server.UrlEncode(productName) + "";
mail.Body += "<a href=" + MyUrl + ">Demo Download</a>";
Run Code Online (Sandbox Code Playgroud)
但我仍然得到如下输出:
http://www.abc.co.in/Download.aspx?period=12-Apr-2013&ProductName=Otja
那么我的代码有什么问题以及如何解码呢download.aspx?
我在我的应用程序中有登录页面,因为我已将我的指定ID保存在Cookies中
Response.Cookies["DesignationID"].Value = ds.Tables[0].Rows[0]["DesignationID"].ToString();
Run Code Online (Sandbox Code Playgroud)
在用户登录之后在另一个页面中我想要检索该cookie值,所以我编写了类似的代码
if (Convert.ToInt32(Request.Cookies["DesignationID"].Value = 2))
Run Code Online (Sandbox Code Playgroud)
但它显示错误,如不能隐式将类型'int'转换为'string'c#,红色虚线在2以下...所以请给我一些提示......