Click or drag to resize

ExtensionsToHTMLHidden Method (Object, String)

Gives HTML code for hidden data

Namespace:  SOWIWeb.Helper
Assembly:  SOWIWeb.Helper (in SOWIWeb.Helper.dll) Version: 19.1.23.1 (19.1.23.622)
Syntax
public static string ToHTMLHidden(
	this Object pData,
	string pName = ""
)

Parameters

pData
Type: SystemObject
Value to be hidden
Note Note
Data type boolean puts text true or false
pName (Optional)
Type: SystemString
Value for HTML attribute Name and ID
Note Note

HTML attribute ID convert to MVC field identification see GetMVCFieldIdentification(String)

If parameter pName empty then puts a new GUID

Return Value

Type: String
HTML code syntax
<input type ="hidden" name ="[pName]" id ="[pName.GetMVCFieldIdentification()]" value ="[pData]" />";

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Object. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Examples
Example use in a CSHTML code file
@Html.Raw(Model.ID.ToHTMLHidden("ID"))
See Also