Tag: textbox

How to allow only numbers in a textbox in C# Windows Application ?

Want to allow the user to enter only numbers or integer values in a textbox in a C# Winforms Application ? . Below is a sample code snippet that demonstrates how to do it . How to allow only numbers in a textbox in C# Windows Application ? Assume that the text box name is “actxt” , we can map the Key Press event of…

How to define MaxLength property for a textbox in ASP.NET MVC Razor View?

Below is a sample code snippet which demonstrates how to define MaxLength property for a textbox in ASP.NET MVC Razor View. @{ if (@ViewContext.ViewData.ModelState.IsValid) { ViewBag.Title = “Index”; } } <h2>Abundant Code</h2> @Html.TextBoxFor (model => model.FirstName, new { maxlength = “100” }); Tutorials you might find interesting:Quick Tip —CSS Containment Module by @gilfinkC Program to search a number in an [email protected]_vaultSenthil-Kumar-B-Posted-by-Senthil-Kumar-B-August-12-2020-CSharp-3-Min-Read-Microsoft-had-released-the-preview-version-of-.NET-5-some-time-back-which-comes-with-C-9-Preview-too.-While-it-is-sti…