A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/NLog/NLog/wiki/AspNet-HttpContext-Item-Layout-Renderer below:

AspNet HttpContext Item Layout Renderer · NLog/NLog Wiki · GitHub

ASP.NET Item variable from HttpContext.Items dictionary. Useful for storing state per request basis.

Platforms Supported: All

${aspnet-item:variable=String:objectpath=String:format=String}

You can set the value of an ASP.NET Item variable by using the following code:

Example usage of ${aspnet-item}

HttpContext.Items["myvariable"] = 123;
HttpContext.Items["stringvariable"] = "aaa BBB";
HttpContext.Items["anothervariable"] = DateTime.Now;

${aspnet-item:variable=myvariable} - produces "123"
${aspnet-item:variable=anothervariable} - produces "01/01/2006 00:00:00"
${aspnet-item:variable=anothervariable:culture=pl-PL} - produces "2006-01-01 00:00:00"
${aspnet-item:variable=myvariable:padding=5} - produces "  123"
${aspnet-item:variable=myvariable:padding=-5} - produces "123  "
${aspnet-item:variable=stringvariable:upperCase=true} - produces "AAA BBB"

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4