Sunday, 6 April 2014

call function or do something after ' x ' times in jquery


    //--- call function after 10 seconds.
    setTimeout("here specify what you want to do", 10000);

Wednesday, 2 April 2014

Reading session value from jquery using WebHandler

using System;
using System.Web;
using System.Web.SessionState;
using System.Web.Script.Serialization;

public class ReadSession : IHttpHandler,IReadOnlySessionState
{
    public void ProcessRequest(HttpContext context)
    {
        context.Response.ContentType = "application/json";
        context.Response.Write(new JavaScriptSerializer().Serialize(new
        {
            Key = context.Request["key"],
            Value = (context.Session[context.Request["key"]]!=null && context.Session[context.Request["key"]]!="" ? context.Session[context.Request["key"]]:"")
        }));
    }

    public bool IsReusable
    {
        get { return true; }
    }
}


/*-------( In jquery just call like this )--------*/


 $.getJSON('/ReadSession.ashx', { key: key }, function (result) {
        alert(result.Value);
    });

Extracting Nupkg files using command line

Rename it to zip first then extract files as below 1.     Rename-Item -Path A_Package.nupkg -NewName A_Package.zip 2.     Make sure to repla...