if(!string.IsNullOrEmpty(Session["emp_num"] as string))
{

amychang2014 發表在 痞客邦 留言(0) 人氣()

Encode

public static string Base64Encode(string plainText)

amychang2014 發表在 痞客邦 留言(0) 人氣()

Page.RegisterClientScriptBlock("AlertMsg", "<script language=\'javascript\'>alert(\'" + msg + "\')</script>");

 

amychang2014 發表在 痞客邦 留言(0) 人氣()

string encoded = System.Web.HttpUtility.UrlEncode(input);
string decoded =  System.Web.HttpUtility.UrlDecode(encoded);

amychang2014 發表在 痞客邦 留言(0) 人氣()

enum Colors { None=0, Red = 1, Green = 2, Blue = 4 };
 string[] colorStrings = { "0", "2", "8", "blue", "Blue", "Yellow", "Red, Green" };

Colors colorValue = (Colors) Enum.Parse(typeof(Colors), colorString);

amychang2014 發表在 痞客邦 留言(0) 人氣()

http://stackoverflow.com/questions/19098797/fastest-way-to-flatten-un-flatten-nested-json-objects/19101235#19101235

 

amychang2014 發表在 痞客邦 留言(0) 人氣()

注意jQuery內傳的參數名稱和WebService的參數名稱要一致!

 

The Other Reason

  1. Not using JSON.stringify to pass parameter value.
  2. 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.
  3. You are actually request data from different domain. Cross Domain Request (CORS)which is not allowed. Please read here
  4. Content type not supply or not correct. Use "application/json; charset=utf-8"
  5. DataType not not supply or not correct. Use json or jsonp

 

amychang2014 發表在 痞客邦 留言(0) 人氣()

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");
    }
}

amychang2014 發表在 痞客邦 留言(0) 人氣()

Response.Redirect("http://www.flashwolves.com" + HttpContext.Current.Request.Url.PathAndQuery);

 

amychang2014 發表在 痞客邦 留言(0) 人氣()

DataSet 廠商專頁ds = DBstatic.廠商專頁ds;

DataRow[] updateRow = 廠商專頁ds.Tables[0].Select("專頁編號 = '" + 專頁編號 + "'");

amychang2014 發表在 痞客邦 留言(0) 人氣()