Mohan J

Mohan J

  • NA
  • 96
  • 31.5k

Still Value Retained eventhough EnableViewState set to FALSE? Why?

Nov 4 2012 7:35 AM
Hi,
I am New to asp.net. I use a Textbox and a Button in the Page. I disabled Enable View state for the textbox control and Page level also. I didn't write any code in Button_click() event. I just cause a post back for the button control. During the run time. I typed some text into the textbox and clicked button, but after post back the value is still maintained in the Textbox control. I have read "if enableviewstate set to false for the particular control,that control will not maintain the value after the postback. But why the textbox maintains value even enableviewstate set to false in my project. Please help me. The best answer will be appreciated.

The code I have applied as follows:

<%@ Page Language="C#" AutoEventWireup="true" EnableViewState="false"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<asp:TextBox ID="TextBox1" runat="server" EnableViewState="False"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button" />


Thanks in Advance.

Answers (1)