|
using System;
namespace piers7.Web.Controls
{
/// <summary>
/// A <see cref="WebParameterAttribute"/> that's specifically bound to the
/// a parameter in the query string (Request.QueryString collection)
/// </summary>
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple=false, Inherited=true)]
public sealed class QueryParameterAttribute : WebParameterAttribute
{
#region Constructors
/// <summary>
/// Creates a new QueryParameterAttribute to load a field from an identically-named
/// parameter in the QueryString collection, if it exists.
/// The parameter has no default value, and is not required
/// </summary>
public QueryParameterAttribute() {
}
/// <summary>
/// Creates a new QueryParameterAttribute to load a field from the given parameter
/// in the QueryString collection, if it exists.
/// The parameter has no default value, and is not required
/// </summary>
/// <param name="paramName">The key of a parameter in the QueryString collections</param>
public QueryParameterAttribute(string paramName) : base(paramName) {
}
#endregion
/// <summary>
/// Retrieves an item from the QueryString by key
/// </summary>
protected override string GetValue(string paramName, System.Web.HttpRequest request)
{
return request.QueryString[paramName];
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
There's some kinda mutex between money and the time to enjoy it, and it's called work.