.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

Can we validate a DropDownList by RequiredFieldValidator?

Posted By :Narayanan     Posted Date :November 01, 2011    Points :40   Category :ASP.Net 
Yes

You can also find related Interview Question to Can we validate a DropDownList by RequiredFieldValidator?  below: 

What is the difference between ListBox (Filled with data) and DropDownList (Filled with data), in terms of SelectedIndex property?

  
The default value of the SelectedIndex property of the Listbox is -1, which indicates that no item is selected in the Listbox. However, the DropDownList control overrides this property and sets the default value to 0, which indicates the first item in the list. (More...)

Does ViewState is responsible for maintaining data across the Page Post Back for Postback controls (like textbox, dropdownlist) and non-postbackcontrols(like label)?

  
It is false. For NonPostback controls it is true but for postback controls, ASP.NET retrieves their values one by one from the HTTP request and copies them to the control values while creating the HTTP response. (More...)

How to validate a Email-address, in Form using JavaScript?

  
We can validate it through the reg expressions. For example we can declare all the reg expressions of the email in a variable as follows.

var reg = /^([A-Za-z0-9_-.])+@([A-Za-z0-9_-.])+.([A-Za-z]{2,4})$/; We need to compare the actual value with this expression for the validation. (More...)

How do you validate the controls in an ASP.NET page?

  
Using special validation controls such as Range Validator, Email Validator we can validate the controls in ASP.NET page. (More...)

How do we validate numeric values in javascript?

  
Using evt.which or event.keyCode

the value will be numeric if it is between 47 and 58 (More...)

In the page load event I assigned DropDownList's DataSource property to a valid list. On the submit button click.. the same DataSource property is coming as null. Why?

  
As ViewState is not storing the DataSource property.

We have to use Items property of DropDownList to get the items back. (More...)

You are working on an ASP.NET application. One of the drop down list contans 1 lakh records. The page posting becomes very slow. How to overcome this? You just need the selected index of the dropdownlist on submit.

  
Use EnableVieState=false. On the dropdown change event, set a hidden field value to the selected index.

Disabling view state helps us in reducing the postback load. (More...)

How To Validate If TextBox Contains A Valid Date?

  


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


(More...)

How to validate an email online?

  
Use SMTP Commands to connect to mail server.

1. Use nslookup

2. telnet to mail server

3. Use commands HELO, MAIL FROM:, RCPT TO: (More...)

How to validate the listbox for the duplicate values from textbox.

  
It can be done like below-

on the button click event of your add button you can check, if the already entered value and the textbox values are same or not. if both are same, don't allow it else write the new value like below-

foreach(listItem item in ListBox.Items)
{
if(Item.Text != txtbox1.Text)
{
lb.Items.Add(txtbox.Text);
}
else
{
//add the new value;
} (More...)

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

  
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;
} (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