@Html.ListBox( “Countries”, ViewBag.AllCountries as MultiSelectList, new { @class = “form-control”, data_placeholder = “Choose a Country…” } )
@Html.ListBox( “Countries”, ViewBag.AllCountries as MultiSelectList, new { @class = “form-control”, data_placeholder = “Choose a Country…” } )
new[] {“,”, “/”}.Any(input.Contains) or you can use Regex Regex.IsMatch(input, @”[,/]”);
To reload a section of the page, you could use jquerys load with the current url and specify the fragment you need, which would be the same element that load is called on, in our below case #myDivId function updateDivContent() { $(“#myDivId”).load(window.location.href + ” #myDivId” ); }
string myValueToSplit = “Istanbul, Tokyo, Seoul, Bangkok, Bali, Minsk, Belgrade, Kiev”; var theFirstValue = myValueToSplit.Split(‘,’)[0]; //OUTPUT: theFirstValue = “Istanbul” //You can change [0] as you wish. //For example, if you want to get Kiev, make it [7]
For all the Devex Components, you can use ControlStyle > CssClass property to apply your custom CSS class (Example 1 and 2) or you can do it with parameter (if it is allowed – as in Example 3). Here is 3 examples for MVC: @Html.DevExpress().SpinEditFor(m => m.Books.Rating, settings => { settings.Properties.SpinButtons.ShowIncrementButtons = true; settings.Properties.Increment = […]
The Stopwatch object is often used to measure how long things take. One quick thing to remember here is that it will take the time for everything you do between starting and stopping it, so make sure you only put the actual code you want to time between those.
using System; using System.Web.UI; using System.Collections.Specialized; public partial class _Default : Page { protected void Page_Load(object sender, EventArgs e) { NameValueCollection headers = base.Request.Headers; for (int i = 0; i < headers.Count; i++) { string key = headers.GetKey(i); string value = headers.Get(i); base.Response.Write(key + ” = ” + value + “<br/>”); } } }