Home Interview Questions and AnswersTechnical Interview Questions and Answers.NET ASP.Net Interview Questions and Answers for Freshers and Experience Part-6

asp.net31. Which method is used to force all the validation controls to run?

The Page.Validate() method is used to force all the validation controls to run and to perform validation.

32. Which method has been introduced in ASP.NET 4.0 to redirect a page permanently?

The RedirectPermanent() method added in ASP.NET 4.0 to redirect a page permanently. The following code snippet is an example of the RedirectPermanent() method:
RedirectPermanent(“/path/Aboutus.aspx”);

33. How can you send an email message from an ASP.NET Web page?

You can use the System.Net.Mail.MailMessage and the System.Net.Mail.SmtpMail classes to send an email in your Web pages. In order to send an email through your mail server, you need to create an object of the SmtpClient class and set the server name, port, and credentials.

34. What is the difference between the Response.Write() and Response.Output.Write() methods?

The Response.Write() method allows you to write the normal output; whereas, theResponse.Output.Write() method allows you to write the formatted output.

35. What does the Orientation property do in a Menu control?

Orientation property of the Menu control sets the horizontal or vertical display of a menu on a Web page. By default, the orientation is vertical.

36. Differentiate between client-side and server-side validations in Web pages.

Client-side validations take place at the client end with the help of JavaScript and VBScript before the Web page is sent to the server. On the other hand, server-side validations take place at the server end.

You may also like

Leave a Comment