Posts

ASP.NET AUTHENTICATION INTERVIEW QUESTIONS

What is the advantage of using Forms authentication? The advantage of using Forms authentication is that users do not have to be member of a domain-based network to have access to your application. Another advantage is that many Web applications, particularly commercial sites where customers order products, want to have access to user information. Forms authentication makes these types of applications easier to create. List the steps to use Forms authentication in a web application? 1.Set the authentication mode in Web.config to Forms. 2.Create a Web form to collect logon information. 3.Create a file or database to store user names and passwords. 4.Write code to add new users to the user file or database. 5.Write code to authenticate users against the user file or database. What happens when someone accesses a Web application that uses Forms authentication? When someone accesses a Web application that uses Forms authentication,  ASP.NET  displays the logon Web form speci...

Understand FormCollection in MVC Controller

Image
We know that there are various ways to collect data from a view to a collection, FomrCollection is one of them. We will implement a simple example of a FomrCollection shortly. To implement it we need to create a MVC application. Here is the view to create the HTML form element We are using a .aspx view in this application and a HTML helper class to generate HTML elements. If we look closely at the form element we will see that the form data will be submited for the “savedata” action defined within the “person” controller. Have a look at the following code. <% @   Page   Language ="C#"   Inherits ="System.Web.Mvc.ViewPage<MVC_Test.Models.person>"   %> <! DOCTYPE   html > < html > < head   runat ="server">      < meta   name ="viewport"   content ="width=device-width"   />      < title > Index </ title > </ head > < body > ...