enable viewstate for only one control on the page

  • Thread starter Thread starter thomasamillergoogle
  • Start date Start date
T

thomasamillergoogle

I have a page that has hundreds of textboxes added dynamically by
writing out "<input type = text name=ctl_99>". In other words, these
are NOT asp.net web controls.

I want to enable viewstate for only ONE control, it is a dropdown
called drpOrg. This dropdown IS an asp.net web control.

Please help.

Tom
 
Tom,

You have to put the enableviewstate property of the page to false:

<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" EnableViewState="false"
AutoEventWireup="false" Inherits="WebApplication1.WebForm1" %>

And then you have to put the enableviewstate property of the dropdown
control to true:

<asp:DropDownList EnableViewState=True id="DropDownList1" style="Z-INDEX:
102; LEFT: 424px; POSITION: absolute; TOP:
88px"runat="server"></asp:DropDownList>


Pablo
 
<asp:DropDownList EnableViewState=True id="DropDownList1" style="Z-INDEX:
102; LEFT: 424px; POSITION: absolute; TOP:
88px"runat="server"></asp:DropDownList>
 

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

Back
Top