Click or drag to resize

IControllerStandardID Property

Optional route element for e.g. data record

Namespace:  SOWIWeb.Helper.Interface
Assembly:  SOWIWeb.Helper (in SOWIWeb.Helper.dll) Version: 19.1.23.1 (19.1.23.622)
Syntax
int ID { get; }

Property Value

Type: Int32
Examples
A example to read the ID
/// <summary>
/// Get route data parameter id.
/// If object no exist then gives 0 return
/// </summary>
public int ID
{
    get
    {
        //* exist a route data parameter id *
        if (this.ControllerContext.RouteData.Values["id"] == null)
        {
            return 0;
        }
        else
        {
            return System.Convert.ToInt32(this.ControllerContext.RouteData.Values["id"].ToString());
        }
    }
}
See Also