| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
ASP.NET Request Query String key/value pairs.
Platforms Supported: All
Introduced in NLog.Web 4.3
${aspnet-request-querystring:items=String:outputFormat:Enum
:itemSeparator=String:valueSeparator=String
:valuesOnly=Boolean}
items - Query String key(s). A list of keys can be passed as comma separated values, e.g.: Key1,Key2 (Not specified means all)
Introduced with NLog.Web / NLog.Web.AspNetCore v5.2.1, and replaces the queryStringKeys-option.
With NLog.Web / NLog.Web.AspNetCore v4.3.1 then all key/value pairs will be rendered, when not specified.
exclude - Query String key names to be excluded. A list of keys can be passed as comma separated values, e.g.: Key1,Key2
Introduced with NLog.Web v5.2.2
Introduced in NLog.Web.AspNetCore 4.4 / NLog.Web 4.5
Introduced in NLog.Web.AspNetCore 4.4 / NLog.Web 4.5
Introduced in NLog.Web / NLog.Web.AspNetCore v4.6
Introduced in NLog.Web / NLog.Web.AspNetCore v5.1.1
Use this layout renderer to insert the value of the specified query string parameters stored in the ASP.NET Query String collection.
In C# code:
Response.Redirect("myPage.aspx?key1=value1&id=d4b20a34-6231-4201-83a6-c72599e41164");${aspnet-request-querystring:items=key1}
Will print:
"key1=value1"
${aspnet-request-querystring:items=key1,id}
Will print:
"key1=value1,id=d4b20a34-6231-4201-83a6-c72599e41164"
${aspnet-request-querystring:items=key1:OutputFormat=JSON}
Will print:
[{"key1":"value1"}]${aspnet-request-querystring:items=key1,id:OutputFormat=JSON}
Will print:
[{"key1":"value1","id":"d4b20a34-6231-4201-83a6-c72599e41164"}]${aspnet-request-querystring:items=key1:OutputFormat=JsonDictionary}
Will print:
{"key1":"value1"}${aspnet-request-querystring:items=key1:ValuesOnly=true}
Will print:
"value1"
${aspnet-request-querystring:items=key1:OutputFormat=JSON:ValuesOnly=true}
Will print:
["value1"]${aspnet-request-querystring:items=key1,id:OutputFormat=JSON:ValuesOnly=true}
Will print:
["value1","d4b20a34-6231-4201-83a6-c72599e41164"]- Troubleshooting Guide - See available NLog Targets and Layouts: https://nlog-project.org/config
| Back | FazBrowse Home | New Git URL |