473,408 Members | 2,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

enable viewstate for only one control on the page

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

Nov 19 '05 #1
2 1470
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

"th*****************@yahoo.com" wrote:
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

Nov 19 '05 #2

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

"Pablo Galiano" <Pa**********@discussions.microsoft.com> wrote in message
news:CF**********************************@microsof t.com...
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

"th*****************@yahoo.com" wrote:
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


__________________________________________________ _____________________________
Posted Via Uncensored-News.Com - Accounts Starting At $6.95 - http://www.uncensored-news.com
<><><><><><><> The Worlds Uncensored News Source <><><><><><><><>

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: John Kirksey | last post by:
I have a page that uses an in-place editable DataGrid that supports sorting and paging. EnableViewState is turned ON. At the top of the page are several search fields that allow the user to filter...
3
by: Steve Drake | last post by:
All, I have a CONTROL that contains 1 control (Control ONE), the 1 control that it can contain 1 or 2 control (Control A and B). Control A, raises and event and Control ONE receives this event...
10
by: neo | last post by:
hi, I am studying ASP.NET and have few questions - 1) The session ID and values of controls is stored in VIEWSTATE variable. So now when we put EnableViewState="false" in Page directive and...
8
by: Invalidlastname | last post by:
Hi, We are developing an asp.net application, and we dynamically created certain literal controls to represent some read-only text for certain editable controls. However, recently we found an issue...
7
by: et | last post by:
I'm not sure I understand the use of the ViewState. Do I understand correctly that values of controls are automatically held in a hidden control called ViewState? If so, then why can't we get...
3
by: swesorick | last post by:
I would like 95% of my site to have the viewstate disabled, in order to reduce the size of my pages. However, there are about 5% of the pages on my site that will require viewstate. Is there...
10
by: Robert | last post by:
I have an app that was originally 1.1, now migrated to 2.0 and have run into some sporadic viewstate errors...usually saying the viewstate is invalid, eventvalidation failed or mac error. My web...
6
by: hitendra15 | last post by:
Hi I have created web user control which has Repeater control and Linkbutton in ItemTemplate of repeater control, following is the code for this control On first load it runs fine but when...
12
by: Nick C | last post by:
Hi How can i reduce the viewstate for my asp.net application. It is getting very large now. What is a good solution? thanks N
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.