asp.net mvc 3 - C# Convert.ToString("D2", Dropdownlist value) -
I'm trying to convert a value from a dropdown list in a view in the MVC format to the string I dropdown list "01" is included in the value, but when I try to convert it to a string in the form of "1" it receives the value. I want to see how the dropdown is showing in the list. I.e "01" Please find your code below. HELP appreciated.
name property collection archive = new name value compilation (); String Starthur = Convert. Toaster (collection ["quoststor"]);
I know that I can change it later from 01 to the code below, but I want it to change itself in the above code. Thanks
string s = startHour.ToString ("D2")
Modify your code in this form,
string startHour = string.Format (" {0: D2} ", collection [" combostarthour "]? String.Empty ;
Whoever handles the null will handle.
Comments
Post a Comment