if(!string.IsNullOrEmpty(Session["emp_num"] as string))
{
//The code
}
http://stackoverflow.com/questions/7172910/checking-session-if-empty-or-not
amychang2014 發表在 痞客邦 留言(0) 人氣(276)
Encode
public static string Base64Encode(string plainText)
{
var plainTextBytes =System.Text.Encoding.UTF8.GetBytes(plainText);
returnSystem.Convert.ToBase64String(plainTextBytes);
}
amychang2014 發表在 痞客邦 留言(0) 人氣(113)
Page.RegisterClientScriptBlock("AlertMsg", "<script language=\'javascript\'>alert(\'" + msg + "\')</script>");
http://www.dotblogs.com.tw/mis0800/archive/2014/03/15/144401.aspx?fid=72169
amychang2014 發表在 痞客邦 留言(0) 人氣(82)
string encoded = System.Web.HttpUtility.UrlEncode(input);
string decoded = System.Web.HttpUtility.UrlDecode(encoded);
amychang2014 發表在 痞客邦 留言(0) 人氣(7,249)
enum Colors { None=0, Red = 1, Green = 2, Blue = 4 };
string[] colorStrings = { "0", "2", "8", "blue", "Blue", "Yellow", "Red, Green" };
amychang2014 發表在 痞客邦 留言(0) 人氣(76)
http://stackoverflow.com/questions/19098797/fastest-way-to-flatten-un-flatten-nested-json-objects/19101235#19101235
http://jsfiddle.net/3rmstg5p/7/
amychang2014 發表在 痞客邦 留言(0) 人氣(567)
注意jQuery內傳的參數名稱和WebService的參數名稱要一致!
The Other Reason
Not using
JSON.stringify to pass parameter value.
If you not supply
type in jQuery, it will use
GET method which is not accept in your webservice configuration. Add (
type : "POST ) in your jQuery code to use
POST method.
You are actually request data from different domain. Cross Domain Request (CORS)which is not allowed. Please read
here
Content type not supply or not correct. Use "
application/json; charset=utf-8"
DataType not not supply or not correct. Use
json or
jsonp
amychang2014 發表在 痞客邦 留言(0) 人氣(2,055)
void Application_BeginRequest(object sender, EventArgs e)
{
HttpApplication app = sender as HttpApplication;
if(app.Request.Path.IndexOf("FriendlyPage.html") > 0)
{
app.Context.RewritePath("/UnfriendlyPage.aspx?SomeQuery=12345");
}
}
http://www.codeproject.com/Articles/33341/URL-Rewriting-using-ASP-NET-for-SEO
amychang2014 發表在 痞客邦 留言(0) 人氣(46)
Response.Redirect("http://www.flashwolves.com" + HttpContext.Current.Request.Url.PathAndQuery);
http://stackoverflow.com/questions/593709/how-to-get-the-url-of-the-current-page-in-c-sharp
amychang2014 發表在 痞客邦 留言(0) 人氣(478)
DataSet 廠商專頁ds = DBstatic.廠商專頁ds;
DataRow[] updateRow = 廠商專頁ds.Tables[0].Select("專頁編號 = '" + 專頁編號 + "'");
updateRow[0]["欄位名稱"] = 欄位變數;
DBstatic.廠商專頁ds = 廠商專頁ds;
amychang2014 發表在 痞客邦 留言(0) 人氣(182)