HtmlTextArea viewstate can not be disabled?

  • Thread starter Thread starter Ryan Liu
  • Start date Start date
R

Ryan Liu

Hi,

I have a HtmlTexTArea inside update panel

<SR:UpdatePanel runat="server" ID="upnDetail" ChildrenAsTriggers="false"
UpdateMode="Conditional" EnableViewState="false">
<ContentTemplate>

<SR:PlaceHolder ID="phNetwork" runat="server"
Visible="false" EnableViewState="false">
<asp:Label runat="server"
ID="lblNetworkName"></asp:Label>
<textarea runat="server" readonly="readonly"
id="tarNetworkOverview" cols="60" rows="10"
enableviewstate="false"></textarea>
............

Codebehind I do call
if( ...)
{
lblNetworkName = "llll";
tarNetworkOverview.Value = "text";
}

//otherwise do not set their values

//update the updatepanel
this.upDetail.Update();


-------

But I am surprised to see after post back, I still see text in the text area
which was set previously when if (true).

But The asp:Label works as expected, it will be clean up or set.

Seems the server side textarea's view state is always enabled ?!

Thanks!
Ryan
 
with textarea's viewstate is only used to detect onchange, as the
browser posts the textarea value. labels are not posted back.

in general if you write your code correctly, you can disable viewstate
in web config, and cut down page sizes.

-- bruce (sqlwork.com)
 
Back
Top