Completely Remove ViewState For Specific Pages?

Mar 12, 2010

I have a site that features some pages which do not require any post-back functionality. They simply display static HTML and don't even have any associated code. However, since the Master Page has a <form runat="server"> tag which wraps all ContentPlaceHolders, the resulting HTML always contains the ViewState field, i.e:

<input
type="hidden"
id="__VIEWSTATE"
value="/wEPDwUKMjEwNDQyMTMxM2Rk0XhpfvawD3g+fsmZqmeRoPnb9kI="
/>

EDIT: I tried both variants of setting EnableViewState on page level with no luck at all:

<%@ Page Language="C#" EnableViewState="false" %>
<%@ Page Language="C#" EnableViewState="true" %>

I realize, that when decrypted, this value of the input field corresponds to the <form> tag which I cannot remove because it is on my master page. However, I would still like to remove the ViewState field for pages that only display static HTML. Is it possible?

View 6 Replies


Similar Messages:

Mobiles :: Completely Disable Viewstate?

Apr 21, 2010

Completely disabling viewstate

View 6 Replies

Viewstate Field Completely Missing In Safari?

Dec 9, 2010

This is happening in multiple versions of Safari, including 5.xIt will post _EVENTTARGET=&_EVENTARGUMENT= but nothing for __VIEWSTATE=This is only happening in Safari, and only on one page of our site.I can't reproduce it - we've spent days trying to. The viewstate isnt overly huge on this page.

View 2 Replies

Completely Script Process Of Importing SSL Certificate And Binding To Specific Site

Feb 22, 2010

I have been looking around for a solution for this problem that works across different versions of Windows Server & IIS, but so far I couldn't find a reasonable solution, what I need is some sort of a script or a command line tool, that takes a certificate file (pfx) for example and then either using the same script or tool find a way to configure one website to use this certificate.

View 1 Replies

C# - Designing All Pages Completely In Codebehind?

Aug 1, 2010

Our current web portal at work was a port from a classic ASP codebase. Currently, all pages in our project extend a custom Page class called PortalPage. It handles login/logout, provides access to a public User object for the currently authenticated user, and adds the standard page header and footer to all of our pages. Every Page in our site is 100% designed in the codebehind. The ASPX page is not used at all. Every single div, img, and block of text is allocated as an object and added from a C# function, even if it is completely static content (which we have a decent amount of). Example for a page header:

HtmlGenericControl wrapperDiv = new HtmlGeneric("div");
HtmlAnchor bannerLink = new HtmlAnchor();
HtmlImage banner = new HtmlImage();
bannerLink.HRef = "index.aspx";
banner.Src = "mybanner.png";
banner.Alt = "My Site";
bannerLink.Controls.Add(banner);
wrapperDiv.Controls.Add(bannerLink);
this.Page.Controls.Add(wrapperDiv);

Even worse, all Javascript is added to the page as a giant mess of string concatenations:

ClientScript.RegisterClientScriptBlock(this.GetType(), "javascript", @"
<script language='javascript'>
fullUrl = '" + ConfigurationManager.AppSettings["fullUrl"].ToString() + @"';.............

View 4 Replies

C# - How To Remove Or Compress Viewstate

Jan 17, 2011

Just spent a lot of time exorcising asp.net's large (but understandably useful) viewstate from an app, and i think it's worth sharing how it's done.

View 8 Replies

How To Disable Viewstate For A Specific Control

Jan 21, 2011

<asp:TextBox ID="TextBox1" runat="server" EnableViewState="false" />
<asp:Button ID="Button1" runat="server" Text="Button" />

I have set the EnableViewState property to false, but when I click on the button the value in the textbox persists after the postback. Why does the value persist?

View 3 Replies

C# - How To Remove ViewState Entry From Page Without Using MVC Pattern

Dec 3, 2010

I want to remove viewstate from page completely without using MVC pattern.

I am using c# 4.0

View 3 Replies

Web Forms :: What Can Remove All Info From Viewstate And Making The Ispostback Again To False

Apr 23, 2010

I have a strange problem, my webform is loading twice.

when i debug i see ispostback is showing false for both times.

what happened to the first time load , and the viewstate.

What can remove all info from viewstate and making the ispostback again to false.

i am having real difficulty figuring out what is causing this problem.

View 3 Replies

DataSource Controls :: Remove Specific Value In Sql?

Mar 2, 2010

how can i find the value in the field which contain "," and remove it in sql e.g:

the field is: 11,12,13
how can i find 12 and remove it becomes=> 11,13
if the field is 12,13,14==> 13,14
if the field is 9,10,11,12 ==> 9,10,11
if the field is 12 only ,then result is empty

View 4 Replies

JQuery :: How To Remove Every Specific Text In A Table

Sep 29, 2010

[Code]....

how to remove every

[Code]....

View 3 Replies

Controls :: How To Remove Specific Word From String

May 7, 2015

Rs100 - Rs300

Rs5000 - Rs60000

I want to remove Rs how will be remove Rs using substring? 

View 1 Replies

ViewState - How To Persist State Between Two Pages

Feb 16, 2011

On page1.aspx i hava a textbox with id="tb1"
On page2.aspx I have a textbox with id="tb2"

page2.aspx is set as postbackurl for page1.aspx. For both labels enabl;eViewState is true. Shouldn't the text I write in page1 also appear in the label on page2? Can I implement this without looking into Request headers, and setting the text myself?

View 1 Replies

Web Forms :: Enable ViewState Only For Few Pages?

Mar 16, 2010

I want to disable viewstate for nearly all of my pages and I have used the element to do so in my web.config.On a page that specifically uses viewstate, I used the EnableViewState=true. However the page fails to work and the dropdownlists that depended on viewstate are not filled in the postback.How can I enable ViewState for some Pages when it is disabled in WebConfig?

View 12 Replies

State Management :: Disabling Viewstate In Master Pages?

Sep 22, 2010

I have a question regarding disabling viewstate.

I know how to do this in the page, however if I disable in a master page will all child pages and controls be disabled through inheritance?

View 4 Replies

How To Extract Specific Pages In Pdf Using Itextsharp

Dec 6, 2010

How to extract specific pages in pdf using itextsharp?Suppose i have 16 pages of pdf i want to extract page number 2,8,16 from that 16pages.

View 1 Replies

Security :: Redirect To Specific Pages After Log In

Mar 24, 2010

I'm no programmer. I am a student majoring in Business Information Systems. My capstone course requires me to develop a web-enabled database that will allow a company to track their projects. I have set it up this far using the 3.5 dynamic data page. My database is fine, however I need to set it up so that Admins can view the entire site and have the ability to edit, view, and delete items, and where users can only edit projects that they are assigned. Is what I'm looking to do possible?

View 4 Replies

MVC :: Remove ALL Output Cached Pages?

Jan 20, 2011

How do I remove all of the pages I have placed in the output cache? I know you can use
HttpResponse.RemoveOutputCacheItem to remove a single page but how do I "clear" it, i.e. removing ALL pages?

View 5 Replies

How To Change Meta Description On Specific Pages

Nov 24, 2010

I want to know if there is way to change meta description on specific pages, but to keep the meta data from the master page for the pages where I haven't specified any info.

I am trying this approach:

[code]....

Which adds the description tag properly, but I want in same time to remove/disable the meta tag from the master page. Is that possible?

View 1 Replies

Web Forms :: Marking Specific Pages With A Flag?

Nov 1, 2010

I have a website that has many pages. Half of the pages need to redirect a user to a specific page. The other half DO NOT need to redirect a user. How can I mark a page as needing / not needing redirection without going into each Page_Load and manually writing my code. I was thinking about creating a MasterPage and creating a virtual property called NeedsRedirection and overriding it in the webpages, but I soon realized that the webpages still do not INHERIT from the master page. Any other suggestions as how to mark a page as needing redirection? Can I do this in the markup to make it easy?

View 1 Replies

Security :: How To Use Forms Authentication On Specific Aspx Pages

Feb 15, 2010

I want to use the login component with forms authentication, but i don't want to use the whole package. I have a database with users in it, and i create the users manually, through another section of my site. I will authenticate them using my own functions, in the Authenticate event.

But, specifying the forms authentication in web.config, i seem to recall having seen somewhere, that i could add pages that were protected, while the rest of the site wasn't.

How do i do this? Currently, i have only 1 page that i want to protect.

View 2 Replies

How To Organized Page Specific CSS Link Tags With Spark View Pages

Mar 12, 2010

I'm currently using ASP.NET MVC 2 and the spark view engine. The main master page (application.spark) contains all of the CSS link tags that need to be present for all pages (global stuff). However, I have some content pages that have page specific CSS tags and currently I'm just sticking the link tag in the body as something like:

<content name="MainContent">
<!-- page specific csss -->
<link rel="stylesheet" href="/Content/css/page_specific.css" />

My problem is that when the page renders, this tag ends up in the which is not where it needs to be. Is there a solution for this?

I had was to check the controller in the Application.spark page and write out which page specific css file is required for that particular controller, however, that solution doesn't seem to scale well and I would imagine there is some way of creating the link in the child page and having it render where it's supposed to by the browser.

View 1 Replies

Crystal Reports :: Remove The Default Space Between Two Pages In Crosstab Report?

Jul 3, 2010

How can i remove the default space between two pages in Crosstab report

View 1 Replies

State Management :: Failed To Load Viewstate. The Control Tree Into Which Viewstate Is Being Loaded Must Match ?

Oct 9, 2010

Now here is the weird thing. First i am running it locally on the built in vs2008 web server.I load my control in fine, do a postback from a linkbutton, locally on my machine it all works fine, no issue.However when it goes onto my host, it falls over with the message:

Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request.Now i also load controls dynamically and use postbacks and things in the admin area of the site...and that works fine, however my front end just keeps failing? See the code behing below:

[Code]....

View 1 Replies

State Management :: ViewState And ObjectDataSource / Getting Values From Viewstate In GetTopThemes?

Jan 11, 2011

I have problem getting values from viewstate in GetTopThemes.

<asp:ObjectDataSource
ID="sourceGetTopThemes"
runat="server"
TypeName="DBConnection"
SelectMethod="GetTopThemes"
EnableViewState="true"></asp:ObjectDataSource>

[Code]....

}

[Code]....

when the page is not Posted back, I saved all values in the viewstate.

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved