Skip to main content

ASP.NET Questions and Answers – Part 4

Why we should using HttpUtility.HtmlEncode?
We should using HttpUtility.HtmlEncode method to sanitize the user input.This prevents users from injecting Javascrip into web application.

What is the difference between ASP.NET MVC 3 Web Application template and ASP.NET MVC 3 Empty Web Application?
One difference between the full ASP.NET MVC 3 Web Application template and the ASP.NET MVC 3 Empty Web Application template is that the empty template doesn’t include an Account Controller.

What is the difference between Session State and View State?
Both Session State and View State used to keep track data between the post back. Session State is server based. View State is a client based. (ASP.NET State Management Overview)

ASP.NET session state enables you to store and retrieve values for a user as the user navigates ASP.NET pages in a Web application. ASP.NET session state identifies requests from the same browser during a limited time window as a session, and provides a way to persist variable values for the duration of that session. (ASP.NET Session State Overview)

View state is the method that the ASP.NET page framework uses to preserve page and control values between round trips. When the HTML markup for the page is rendered, the current state of the page and values that must be retained during postback are serialized into base64-encoded strings. This information is then put into the view state hidden field or fields. (ASP.NET View State Overview).

Related posts:

Comments

Popular posts from this blog

Visual Studio 2010 Keyboard Shortcuts

These keyboard shortcuts are helpful. Some of them are not document in Visual Studio 2010 Express, for example: <Ctrl> F5 to run the application without debug <Ctrl> Period or <Ctrl> Space for code completion. <Ctr> <Shift> <B> to build the solution For more download the Visual Studio 2010 Keybinding Posters from Microsoft. Credit:  Visual Studio 2010 Keyboard Shortcuts - ScottGu's Blog DevCurry: 30 Favorite Visual Studio Keyboard Shortcuts

Install Android Development Tools on Ubuntu 12.10 (Quantal Quetzal)

First thing first. Make sure Java Development Kit (JDK) install. Go to Terminal and type 'Java -version' to check. You should see the following: java version "1.7.0_07" OpenJDK Runtime Environment (IcedTea7 2.3.2) (7u7-2.3.2a-1ubuntu1) OpenJDK Server VM (build 23.2-b09, mixed mode) If Java Development Kit is not installed, you can install it from Ubuntu Software Center. Click on Ubuntu Software Center icon from left side bar and search for Java. Here, I selected 'OpenJava JDK 7 runtime' Go to http://www.eclipse.org/downloads/ to download Eclipse Classic 4.2.1 (Juno) Go to your downloads folder and extract it. Move 'eclipse' folder to your home directory. Launch Eclipse 4.2.1 (Juno) from 'eclipse' folder. Install Android Developer Tools (ADT) plugin for Eclipse. Click on Help -> Install New Software and add the URL 'https://dl-ssl.google.com/android/eclipse/' on the input text box next to 'Work with' and click the 'Add

How to mount a VirtualBox shared folder in Ubuntu guest

1. Click on VirtualBox VM Devices and Shared Folders... to create a shared folder, named it SharedFolder, for example. 2. On Ubuntu guest machine, open Terminal 3. Type sudo mkdir /mount/vboxshared 4. Type sudo mount -t vboxsf SharedFolder /media/vboxshared to mount the VirtualBox shared folder as read. To make it read/write, use this command: sudo mount -t vboxsf -o uid=1000,gid=1000 SharedFolder /media/vboxshared If the shared folder is a permanent share and auto mount, make sure your user id in group vboxsf. To add a user id to group vboxsf, using command: sudo usermod -a -G vboxsf linuxuserid Reference: https://help.ubuntu.com/community/VirtualBox/SharedFolders https://forums.virtualbox.org/viewtopic.php?t=3201&amp;highlight=share+folder