Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

call Textboxfor in cs

public static class CustomHtmlHelper {

    public static MvcHtmlString MyFieldBox<TModel, TProperty>(this HtmlHelper<TModel> html, Expression<Func<TModel, TProperty>> expression, String title) {

        StringBuilder sb = new StringBuilder();
        sb.AppendLine("<div class="field-box">");
        sb.AppendLine("<div class="field-box">");
        sb.AppendLine("<label>{0}</label>", title);
        sb.AppendLine("<div class="col-md-7">");
        sb.AppendLine( htmlHelper.TextBoxFor( expression, new { @class = "form-control inline-input" }) );
        sb.AppendLine("</div>");
        sb.AppendLine( htmlHelper.ValidationMessageFor( expression );
        sb.AppendLine("</div>");
        return new MvcHtmlString( sb.ToString() );
    }

}
Comment

PREVIOUS NEXT
Code Example
Csharp :: difference between %e/E, %f/F and %g/G in program C 
Csharp :: how to preset an array c# 
Csharp :: c# convert timestamp to datetime 
Csharp :: Connect secretclient to proxy 
Csharp :: unity check if object is being rendered 
Csharp :: how to move an object with addforce 
Csharp :: Rotate Object/Camera by Mouse 
Csharp :: Retrieving a value in one class that is set in another 
Csharp :: jtoken value is not exact 
Csharp :: Console.WriteLine($"Hello {Ana.ToUpper($)}!"); 
Csharp :: isselected uicollectionview reused 
Csharp :: stackoverflow array c# 
Csharp :: c sharp switch forms 
Csharp :: unitydont play sound until finsihed 
Csharp :: wpf string to byte array 
Csharp :: .net core not returning the sub list 
Csharp :: converting alpha1 into int unity 
Csharp :: c# supplier equivalent 
Csharp :: c# using rename class 
Csharp :: c# access control from another thread 
Csharp :: trigger enter with nav mesh 
Csharp :: what is vector3.one c# 
Csharp :: how to disable button until the value is selected c# 
Csharp :: replace bar c# 
Csharp :: Library dll unless netloaded by AutoCAD 
Csharp :: matric multiplication 
Csharp :: .net return context.Result without extra new objectResult 
Csharp :: player movement script unity 
Csharp :: resharper render pages folder asp.net core 
Csharp :: most popular products code using asp.net core in visual studio code 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =