HtmlTextArea viewstate can not be disabled?

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
 
B

bruce barker

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,817
Latest member
AdalbertoT

Latest Threads

Top