473,385 Members | 1,848 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,385 software developers and data experts.

How to clear Viewstate in aspx (or ascx) page

hi friends,
i am having an aspx page. i want to clear its viewstate on a particular
condition.
Is that possible? If yes, how can i do so?
Plz help me.

Apr 29 '06 #1
2 23367
Hi,

you can try:

Page's own ViewState collection ViewState.Clear()

And for child controls call: ClearChildViewState()

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
"asgars" <as****@gmail.com> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.com...
hi friends,
i am having an aspx page. i want to clear its viewstate on a particular
condition.
Is that possible? If yes, how can i do so?
Plz help me.

Apr 29 '06 #2
To simply wipe the whole viewstate out and go back to a situation as if the
user just opened the page, i find that semding a resposne.redirect to the
page that you are on work quite well.

"asgars" wrote:
hi friends,
i am having an aspx page. i want to clear its viewstate on a particular
condition.
Is that possible? If yes, how can i do so?
Plz help me.

Apr 29 '06 #3

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

Similar topics

7
by: | last post by:
hi, I have got XML tag <fo:block font-weight="bold" font-size="13pt"><!]></fo:block>. Problem is when i gives xmlURL from c# to InputStreamReader in J# code with the aspx web page as XML which...
7
by: Holger (David) Wagner | last post by:
Hi Group, I've searched the Web for precompilers that compile ASPX/ASCX pages just like it can be done with JSPs, but so far, I've only found approaches targetted at increasing the performance....
5
by: Gopal Krish | last post by:
Hello, Can anyone tell me how to strong name a web page? Thanks Gopal
2
by: Niclas Lindblom | last post by:
Hi, I would like to use a separate stylesheet for a .ascx module without changning the stylesheet that is referenced in the .aspx page <HEAD> section Is it possible to reference another...
2
by: Rob | last post by:
Ok, I am a beginner when it comes to ASP.NET and C#. I have been "playing" with Visual Studio 2005 for about 1 week now and I cannot figure out how to create a .aspx or .ascx page in VS 2005. I...
2
by: krallabandi | last post by:
I have a hidden control <input id="FieldSortOrder" type="hidden" name="FieldSortOrder" runat="server"> in a ascx page. I want to store some value in this control in the code behind page. ...
5
by: strikefiend | last post by:
Ok, I'm somewhat new to .NET C# language and am having a bit of trouble. I'm trying to run the javascript confirm() method from my ascx page but I'm currently using C# as the main language of the...
1
by: Handle | last post by:
I want to customize some aspx / ascx files of a precompiled site (the project portofolio web access site). I have no access to source code. Using Visual Studio, when I try to edit one these files...
3
by: Montu76 | last post by:
Hi All, I want to pass values from .apsx page(textbox value) to .ascx page. Any sort of help will be appreciated. Regards
34
by: ismailc | last post by:
Good day, not sure what to do. I have an ascx page with the code displaying the user logged in, i created an iframe src displaying a report but i want to add the logged in id as parameter but...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
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
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...

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.