<asp:DropDownList ID="DdlMonths" runat="server"> <asp:ListItem Enabled="true" Text="Select Month" Value="-1"></asp:ListItem> <asp:ListItem Text="January" Value="1"></asp:ListItem> <asp:ListItem Text="February" Value="2"></asp:ListItem> .... <asp:ListItem Text="December" Value="12"></asp:ListItem> </asp:DropDownList>
You can even use a RequiredFieldValidator
which ignore this item, it considers it as unselected.
<asp:RequiredFieldValidator ID="ReqMonth" runat="server" ControlToValidate="DdlMonths" InitialValue="-1"> </asp:RequiredFieldValidator>
Related Posts:
- HTTP Error 503, the service is unavailable
- How to resolve “Server Error in ‘/’ Application” error?
- Chrome returns “Bad Request – Request Too Long” when navigating to local IIS Express
- What does ‘IISReset’ do?
- What does ‘IISReset’ do?
- “Exception has been thrown by the target of an invocation” error (mscorlib)
- ORA-12154 could not resolve the connect identifier specified
- What are .ashx files in an ASP.NET application?
- Does PHP supports MVP pattern?
- Server.Transfer Vs. Response.Redirect
- W3WP.EXE using 100% CPU – where to start?
- HTTP Error 403.14 – Forbidden – The Web server is configured to not list the contents of this directory
- Error :The remote server returned an error: (401) Unauthorized
- Exception of type ‘System.OutOfMemoryException’ was thrown.
- Cannot read configuration file due to insufficient permissions
- A potentially dangerous Request.Form value was detected from the client
- Could not load file or assembly ‘Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed’
- How to Determine IUSR Password
- ASP.NET Why are sessions timing out, sessionstate timeout set
- What does aspnet_regiis.exe do
- Cannot read configuration file due to insufficient permissions
- Can you recommend a .net template engine?
- How do I resolve “HTTP Error 500.19 – Internal Server Error” on IIS7.0
- Asp.net Hyperlink control equivalent to
- Error ‘2035’ (‘MQRC_NOT_AUTHORIZED’) While Connecting to MQ
- debug=true in web.config = BAD thing?
- Url.Action parameters?
- What is the difference between ASP.NET and ASP.NET MVC?
- Failed to load resource: the server responded with a status of 401 (Unauthorized) /App/AngularJS/angular.min.js
- The following sections have been defined but have not been rendered for the layout page “~/Views/Shared/_Layout.cshtml”: “Scripts”
- The following sections have been defined but have not been rendered for the layout page “~/Views/Shared/_Layout.cshtml”: “Scripts”
- ASP.NET DateTime Picker
- Could not load file or assembly ‘Microsoft.CodeDom.Providers.DotNetCompilerPlatform
- a page can have only one server-side form tag
- “This operation requires IIS integrated pipeline mode.”
- Could not load file or assembly ‘Microsoft.ReportViewer.WebForms’
- Maximum request length exceeded.
- Could not load file or assembly Exception from HRESULT: 0x80131040
- The localhost page isn’t working. localhost redirected you too many times
- Response Content type as CSV
- Unrecognized attribute ‘targetFramework’. Note that attribute names are case-sensitive
- IIS error, Unable to start debugging on the webserver
- How to move div vertically down using CSS
- How to troubleshoot “System.Web.HttpException (0x80004005): File does not exist”?
- jquery $(this).id return Undefined
- How handle Application Error Exception code: 0xc00000fd
- C# function to return array
- “The transaction log for database is full due to ‘LOG_BACKUP'” in a shared host
- jQuery UI ” $(“#datepicker”).datepicker is not a function”
- How to handle Uncaught (in promise) DOMException: The play() request was interrupted by a call to pause()
- The wait operation timed out. ASP
- The wait operation timed out. ASP
- Different between ./ , ../ , ../../ , ~/ on file path(URL) in asp.net
- The request was aborted: Could not create SSL/TLS secure channel
- How can I create a dropdown menu from a List in Tkinter?
- Is “ ” a replacement of ” “?
- Twilio TwilioRestClient does not contain a definition for SendSmsMessage
- how does Request.QueryString work?
- how to call jquery selector from outside kendo window?
- Visual Studio error “Object reference not set to an instance of an object” after install of ASP.NET and Web Tools 2015
- System.web.mvc missing
- Differences between Html.TextboxFor and Html.EditorFor in MVC and Razor
- Infinite Scrolling in Asp.Net MVC with jQuery / AJAX Issues
- Javascript Runtime error: $ is undefined
- WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for jquery
- Regex for password must contain at least eight characters, at least one number and both lower and uppercase letters and special characters
- How to remove error about glyphicons-halflings-regular.woff2 not found
- How to add reference to System.Web.Optimization for MVC-3-converted-to-4 app
- What is ViewModel in MVC?
- What is WebResource.axd?
- What does vary:accept-encoding mean?
- How can I secure passwords stored inside web.config?
- javascript “window.history.forward(1);” not working
- C# Gridview CheckBox Field VS (Template Field + CheckBox)
- How to use the “Using” statement in ASP.net razor webpages?
- Can’t Add View from Controller in VS 2015 : “There was an error running the selected code generator”
- Bootstrap dropdown not working
- Member ‘
‘ cannot be accessed with an instance reference - when do you need .ascx files and how would you use them?
- TypeError: $(…).DataTable is not a function
- System.ComponentModel.Win32Exception: Access is denied Error
- Could not load file or assembly App_Web_ * with a precompiled ASP.NET website project
- If a folder does not exist, create it
- What is the purpose of global.asax in asp.net
- CS1617: Invalid option ‘6’ for /langversion; must be ISO-1, ISO-2, 3, 4, 5 or Default
- How to connect signalR from angularJs
- How to get the URL of the current page in C#
- What is the @Html.DisplayFor syntax for?
- The ‘Access-Control-Allow-Origin’ header contains multiple values
- what is ScriptResource.axd in the page load in web app?
- Call a stored procedure with parameter in c#
- Cannot drop database because it is currently in use
- does not implement interface member
- How to make Check Box List in ASP.Net MVC
- Format of the initialization string does not conform to specification starting at index 0
- Could not find any resources appropriate for the specified culture or the neutral culture
- Sequence contains more than one element
- Parser Error Message: Could not load type ‘sometype’
- The server tag is not well formed error
- How to set session timeout in web.config