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}
Introduced with NLog.Web v5.1, and replaces the
Variable
-option
Introduced with NLog.Web v5.0
Introduced with NLog.Web v5.0
Introduced with NLog.Web v5.2 and replaces
EvaluateAsNestedProperties
-option
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