6:21 AM

Implementing HTTPS in ASP.Net MVC application

This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters Show hidden characters namespace abc.Filters { public class RedirectToHttpsAttribute : RequireHttpsAttribute { protected override void HandleNonHttpsRequest(AuthorizationContext filterContext) { if(filterContext.HttpContext.Request.ServerVariables["HTTP_X_FORWARDED_PROTO"] == null) { string url = "https://" + filterContext.HttpContext.Request.Url.Host + filterContext.HttpContext.Request.RawUrl; filterContext.Result = new RedirectResult(url, true); } } } } view raw gistfile1.txt hosted with ❤ by GitHub [.....]

3:18 AM

What are callbacks





What are callbacks?

A callback is just a way to store some things to do at a later time.

A callback function is called at the completion of a given task.

The callback takes two arguments, resolve and reject , which are both functions. All your asynchronous code goes inside that callback. If everything is successful, the promise is fulfilled by calling resolve() . In case of an error, reject() is called with an Error object.


A promise is [.....]

Next PostNewer Posts Previous PostOlder Posts Home