473,405 Members | 2,154 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,405 software developers and data experts.

EnableViewState not being set to false

I want to post a form and not have the form maintain it's value. I am have tried setting EnableViewState = False at the control and on Page Load. When I submit the button my selection is returned. What am I missin

Mik
<asp:DropDownList id="DropDownList1" style="Z-INDEX: 101; LEFT: 115px; POSITION: absolute; TOP: 163px" runat="server" Width="154px" Height="67px" EnableViewState="False"><asp:ListItem>Item 1</asp:ListItem><asp:ListItem>Item 2</asp:ListItem><asp:ListItem>Item 3</asp:ListItem><asp:ListItem>Item 4</asp:ListItem></asp:DropDownList>
Nov 18 '05 #1
4 1256
CT
Is this your problem?
http://support.microsoft.com/default...;EN-US;Q316813

--
Carsten Thomsen
Enterprise Development with VS .NET, UML, and MSF
http://www.apress.com/book/bookDisplay.html?bID=105
"Mike Drewery" <an*******@discussions.microsoft.com> wrote in message
news:3C**********************************@microsof t.com...
I want to post a form and not have the form maintain it's value. I am have
tried setting EnableViewState = False at the control and on Page Load.
When I submit the button my selection is returned. What am I missing
Mike

<asp:DropDownList id="DropDownList1" style="Z-INDEX: 101; LEFT: 115px;
POSITION: absolute; TOP: 163px" runat="server" Width="154px" Height="67px"
EnableViewState="False"><asp:ListItem>Item
1</asp:ListItem><asp:ListItem>Item 2</asp:ListItem><asp:ListItem>Item
3</asp:ListItem><asp:ListItem>Item 4</asp:ListItem></asp:DropDownList>

Nov 18 '05 #2
That's not it. I am not using the controls listed. I was using a listbox. If I don't set it to run at server then it works fine. Is this by design? I am new to dotnet and I am trying to get a handle on when to use what controls

Thanks for your reply

Mike
Nov 18 '05 #3
Hi,

in fact it is, ListBox just isn't listed because it uses both 'worlds' in
fact. It stores all items to ViewState, but posts the selection along with
the form (despite do you have ViewState enabled or not).

To reset the selection, you need to set SelectedIndex manually to -1 or call
ClearSelection() method of ListBox.

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
http://blogs.aspadvice.com/joteke

"Mike Drewery" <an*******@discussions.microsoft.com> wrote in message
news:D5**********************************@microsof t.com...
That's not it. I am not using the controls listed. I was using a listbox. If I don't set it to run at server then it works fine. Is this by
design? I am new to dotnet and I am trying to get a handle on when to use
what controls.
Thanks for your reply

Mike

Nov 18 '05 #4
This doesn't clear it

DropDownList1.ClearSelection(
DropDownList1.SelectedIndex = (-1

in page on load

Thank
Mike
Nov 18 '05 #5

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

Similar topics

1
by: Ravikanth[MVP] | last post by:
Hi Even though the Viewstate has been disabled, ASP.NET still uses about twenty bytes for Viewstate. Not only can you disable Viewstate at the page level, but you can also disable Viewstate...
1
by: Ravikanth[MVP] | last post by:
Hi Even though the Viewstate has been disabled, ASP.NET still uses about twenty bytes for Viewstate. Not only can you disable Viewstate at the page level, but you can also disable Viewstate...
7
by: Max Metral | last post by:
I have a Web.config in my application root dir with the following pages directive: <pages buffer="true" enableViewState="false" enableSessionState="false" enableViewStateMac="false"/> And...
7
by: Just D. | last post by:
Does anybody know any good solution to avoid this setting to be enabled? I guess Microsoft doesn't care of the Internet connection of the potential client working with asp.net. This EnableViewState...
3
by: JohnZing | last post by:
I Have EnableViewState="false" in the top of my page has you can see below <%@ Page Language="VB" EnableViewState="false" MasterPageFile="~/MasterPage.master" AutoEventWireup="false...... I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.