//No 'Access-Control-Allow-Origin' header is present on the requested resource__ Access-Control-Allow-Origin error mostly when you access web api without client like from ajax or javascrip call Issue can be resolved in following steps. 1) Goto global aspx calss of WebApi 2) After default start method add below mentioned code in step 3 3) protected void Application_BeginRequest(object sender, EventArgs e) { HttpContext.Current.Response.AddHeader("Access-Control-Allow-Origin", "*"); if (HttpContext.Current.Request.HttpMethod == "OPTIONS") { HttpContext.Current.Response.AddHeader("Access-Control-Allow-Methods", "POST, PUT, DELETE"); HttpContext.Current.Response.AddHeader("Access-Control-Allow-Headers", "Content-Type, Accept"); HttpContext.Current.Response.AddHeader("Access-Control-Max-Age", "1728000"); HttpContext.Current.Response.End(); } } ___Stay Happy_____________
Introduction In this tutorial, we will learn how to add @author comments to every new class that we create. We can achieve it using either of the following two solutions Solution 1: Automatically add @author comments to every new class using Files and Code Templates Open File -> Settings -> Editor -> File and Code Templates -> Includes Click on Includes . Under File Header , enter the following comments text /** * @author ${USER} * @Date ${DATE} */ Intellij - add @author comments Solution 2: Autocompletion of @author Open File -> Settings -> Editor -> Live Templates Select Java and then click on + button In Abbreviation, enter @a In template text , enter the following comments /** * @author ${USER} * @Date ${DATE} */ In option , Expands with select SPACE Intellij - Autocompletion @author You can simply add the @author comments by typing @a and then click SPACE
Comments
Post a Comment