.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> ASP.Net >> Post New Question Subscribe to Interview Questions

How you will validate that the selected date from date picker is Monday.

Posted By :Ashutosh Jha     Posted Date :August 31, 2014    Points :40   Category :ASP.Net 
first save the date in string like below-

DateTime selecteddate = Convert.ToDateTime(Txtfromdate.SelectedDateValue.ToString());

and then check for monday

if (selecteddate.DayOfWeek != DayOfWeek.Monday)
{
lblmsg.Text = "Yo must select the monday date only";
return;
}

You can also find related Interview Question to How you will validate that the selected date from date picker is Monday.  below: 

How To Validate If TextBox Contains A Valid Date?

  


ControlToValidate="txtOnlyValidDate" ErrorMessage="CompareValidator"
Operator="DataTypeCheck" Type="Date">


(More...)

How to disable future dates of silverlight date picker?

  
We can do this through the following code.

In xaml :

DisplayDateEnd="{Binding Source={x:Static System:DateTime.Today}, Mode=OneWay}"

Or

In Constructor:

dtpCreatedDate.DisplayDateEnd = DateTime.Now; (More...)

Should validation (did the user enter a real date) occur server-side or client-side? Why?

  
Validation will be done in both sides i.e., at the server side and client side. Server side validation will be done even though client side validation performed on the code because of proper
security reasons. (More...)

How to Find Number of Days for provided date range?

  
Code extract :

TimeSpan DayDifference = Convert.ToDateTime("2009-1-7").Subtract(Convert.ToDateTime("2009-1-1"));


To find the difference of the days, here we have used Subtract method. The Subtract method does not take start date into consideration. Hence, to get the exact number of days for the date range we need to add one more day to the result.

Response.Write("Number of Days : " + DayDifference.Days+1); (More...)

MONTHS_BETWEEN date function is used for what purpose?

  
MONTHS_BETWEEN is used to find the difference between two dates. (More...)

How to find the last restart time and date of sql server?

  
First Check the recent error log
Then Check the creation of TempDb
Click Start and hit Run then type "Net Statistics server" in command prompt.
(More...)

How to find the last backup time and date for particular database

  
step1: open enterprise manager

step2: select the particular database -->properties-->Now we are able to see last full,transaction log backup time and date (More...)

How to get yesterday date in sql server?

  
Just use the follwing query

select yesterdaydate=getdate()-1 (More...)

Date Regular Expression.

  
Date(mm/dd/yyyy) : /^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}$/ (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend