Interview Questions Need To Answers

Posted by Jayakumars under ASP.NET AJAX on 4/19/2013 | Points: 10 | Views : 1009 | Status : [Member] [MVP] | Replies : 2
Interview Questions Need To Answers

1.View State where Stored?
3.Why We are using Razor ?
4.Difference between Razor-> Cshtml and aspx page and advantage this?
5.Why We are using View in Sql Compare with Stored Procedure.
6.what is purpuse using mvc?

Mark as Answer if its helpful to you


Posted by: Satyapriyanayak on: 4/20/2013 [Member] [MVP] Silver | Points: 25

The View State is client state mechanism in the ASP.Net statement management.

The view state is control it will be used to maintain the state of the control across the posted back to the server. The value will be stored in the hidden control. Every time it needs to encryption and decryption (serialize and deserialize across the post backs).

The view state can be enabled by setting the property called EnableViewState="true/false". It can be set in the machine config/ web config/ page directives/ control level.

By default it is false. You can enable it by setting boolean flag.

This can be used with in the page and not across the page.

Viewstate["Version"] = txtVersionName.Text.ToString();

The view state also can store the data using the key and value combination. The data will be serialized and stored in the hidden control You can view the source code page and find the hidden control with _viewstate.

- Increase the page payload (when you have grid with many rows then every thing has to be loaded and retain again with serialize and deserilize)
- Additional overhead while serialize and deserialize.
- Increase the memory allocation on the server.


Assigning and retrieval of view state in

protected void Button1_Click(object sender, System.EventArgs e)
ViewState["FavoriteColor"] = TextBox1.Text.ToString();
ViewState["City"] = TextBox2.Text.ToString();
Label1.Text = "Your data saved in ViewState.";
protected void Button2_Click(object sender, System.EventArgs e)
string color = (string)ViewState["FavoriteColor"];
string city = (string)ViewState["City"];

Label1.Text = "Hi your favorite color is: " + color +
"<br />and you came from: " + city;

If this post helps you mark it as answer

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Snaveen on: 2/14/2014 [Member] Starter | Points: 25

1) ViewState will store in client side

5) View, is nothing but a table structure in sql database. When we prefer this means if we want to communicate with other database information in that case we don't have a permission to fetch that data, that case we just create one view in our database and perform action in our database by using that view table. You can able to perform only select operation, you can't able to perform insert, update , delete actions using view.

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response