473,624 Members | 2,122 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting rid of viewstate in GET posted forms

I'm trying to post data in ASP.NET using the GET method
for the form rather than POST. I've disabled viewstate
on all the controls and at the page level but I still
keep getting _Viewstate in the URL. Is there any way to
control aspx pages so they display tidy querystrings
without all the other stuff?

Thanks

Damon
Nov 17 '05 #1
2 1115
Hi,

Well, as long as the form holds the runat=server attributes ASP.NET will
render __viewstate even if you disable view state for all page controls
and page. if you will remove runat=server attribute toy cant use server
control at this form.

there are two workaround :

1) use client side script to remove __viewstate field before submitting
the form.

2) create dynamically or statically other form without runat=server
attribute, add your fields and data and submit that form.

Natty Gur[MVP]
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #2
Many thanks for the information.

Damon
-----Original Message-----
Hi,

Well, as long as the form holds the runat=server attributes ASP.NET willrender __viewstate even if you disable view state for all page controlsand page. if you will remove runat=server attribute toy cant use servercontrol at this form.

there are two workaround :

1) use client side script to remove __viewstate field before submittingthe form.

2) create dynamically or statically other form without runat=serverattribute, add your fields and data and submit that form.

Natty Gur[MVP]
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***Don't just participate in USENET...get rewarded for it!
.

Nov 17 '05 #3

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

Similar topics

0
1017
by: chris s. | last post by:
I've got a problem concerning Server.Execute and the viewstate. It's not a ViewStateMacEnabled=false problem as it happens - less of a problem and more a question of 'is it possible'. I've got a main aspx page which houses the layout html, and executes another .aspx file using Server.Execute, this is then fed to a writer and finally Response.Write'n. My problem comes when putting a <form runat="server"> inside the child page (the one to...
1
1765
by: Simon | last post by:
Hi everyone, I have a quick question that I hope someone can help me with: I've made a user control that contains a text box and some validation functionality. This control has a few extra properties declared on it over and above that provided by the textbox. As I understand it, part of the process to make this work is, in the property accessor's for the properties that you wish to persist you add
2
2131
by: Jerry O | last post by:
Hi, I appear to have a problem where the user is not kicked back to the forms authentictation url when they post a webform, via a get, that results in a long url due to viewstate. Instead they get the error at the end of the post Web.Config: <authentication mode="Forms"> <forms path = "/" loginUrl = "View/Login.aspx" timeout="1"
5
5955
by: Nathan Sokalski | last post by:
I have a user control that contains three variables which are accessed through public properties. They are declared immediately below the "Web Form Designer Generated Code" section. Every time an event is fired by one of the controls contained in the User Control, these variable are reset. Here is my current code (I have a little more to add later, right now I am just concerned about the variables getting reset): Public Class DatePicker2...
1
3452
by: Tim | last post by:
Greetings! I have a UserControl. On this UserControl is a Panel and a RadioButtonList. The Panel's Visible property is set to false by default. When the user selects a particular RadioButtonList value, a postback is performed and the Panel's Visible property is set to true. Selecting a different RadioButtonList value sets the Visible property to false again. So far, so good. It does, in fact, do this.
10
3076
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 config does specify a machinekey setting: <machineKey validationKey="447C05E8B3A71401CC4CAE5513A7F1A3494A3618EE819316AAD1D58433F236A759D66FB4154500E01EB4E1BC1DE42046E2D652D391CB8367A1649438867A02EB"...
3
1929
by: TC | last post by:
Hey All, I have some classes that I recently built for a website which uses the HttpWebRequest & HttpWebResponse objects from the System.Net namespace. Basically, the classes rap submitted data up, connect to external websites on external servers and post / remove the data from these other sites. It works fine locally but when uploaded to the BCentral production server, the outgoing requests get shutdown.
4
5078
by: DavidF | last post by:
Hi, I'm having a problem with viewstate encryption on one of my websites. To encrypt the viewstate, I'm using the following lines in my web.Config file: <pages theme="Default" viewStateEncryptionMode="Always" enableViewStateMac="true"></pages> <machineKey validationKey="AutoGenerate,IsolateApps" decryptionKey="AutoGenerate,IsolateApps"
0
2226
by: jamestilby | last post by:
Hi all, Hope someone can help with this - I am tearing my hair (singular) out. I developed an application using asp.net 2.0 and Mobile Controls. Up till now I have been testing it with a Pocket PC which runs a version of Internet Explorer. I'm trying to use the application now on a Samsung SGH-F700W which uses a web browser called NetFront 3.3 (this is being supplied by Vodafone in the UK as their answer to the iPhone). On several...
0
8173
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8679
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8475
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7159
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6110
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4079
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2606
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1482
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.