|
Use following line in the Page Init/Load of the specific page you want to remove from the Cache,
Response.Cache.SetCacheability(HttpCacheability.ServerAndNoCache);
HttpCacheability also has few more enumerations.
|
|
|
|
|
I was actually looking for something that I coudl use at the point the user logs out, like being able to tell the browser to remove certain pages from the cache.
I've already tried the thing you suggested (in Page_Load of the given pages), and it's too heavy handed (I need to keep some variables around that can't be put in the Session vars.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Are you sure that session is cleared ? I had the same issue. When URL's are typed straight, it loaded the page. But it will redirect when we hit F5. Is it redirecting for you ? Disabling caching methods didn't worked for me. I think it's browser behavior and we can't control much.
|
|
|
|
|
Also try with Session.Abandon() . I think Session.Clear() clears the values, but the session instance would be still active.
|
|
|
|
|
John Simmons / outlaw programmer wrote: I was actually looking for something that I coudl use at the point the user logs out, like being able to tell the browser to remove certain pages from the cache.
Presently not available in ASP.NET.
John Simmons / outlaw programmer wrote: I've already tried the thing you suggested (in Page_Load of the given pages), and it's too heavy handed (I need to keep some variables around that can't be put in the Session vars.
No other way. I have developed websites which are using HttpCacheability to pages which are to be authenticated. I suggest you to not to use Sessions widely, particularly heavy objects like DataTable....
|
|
|
|
|
hi iam trying to make a global function where all my asp.net .cs files can use it.
its a rather basic function with nothing special inside
anyone know how to make a function global to all of my asp.net .cs file?(need refresh)
thx
|
|
|
|
|
In other words you want to make a static utility class
public static class Utility
{
public static void MyUtilityMethod()
{
}
}
modified on Friday, January 18, 2008 11:29:33 AM
|
|
|
|
|
Colin Angus Mackay wrote: public static class Utility
{
public void MyUtilityMethod(/* args go here*/)
{
// Do stuff here.
}
}
You can't declare an instance member inside a static class, I guess ?
|
|
|
|
|
N a v a n e e t h wrote: You can't declare an instance member inside a static class, I guess ?
Oops! I've corrected it.
|
|
|
|
|
neodeaths wrote: hi iam trying to make a global function where all my asp.net .cs files can use it.
Put your classes in app_code (ASP.NET 2.0 or later) directory which can be accessible from anywhere in the application.
|
|
|
|
|
hi all
help me in this issue...
i have pages with the name default1.aspx and default2.aspx.
from the default1.aspx i have navigated to default2.aspx..
and i have a back button in default2.aspx page.. when i click on back button i should know the previous page (i.e from the page which i have navigated to default2.aspx) and should go there...
can anyone help me in this..
thank you.
siri
|
|
|
|
|
I have page where the users can register with some input fields. I dont want the user to be able to push the backspace button so it navigates to the previous page. How can I do that?
_____________________________
...and justice for all
APe
|
|
|
|
|
hi all,
I have a datagrid with all bound columns and autogenerate columns =false.
The problem is the datagrid headers have not become clickable even afer i have made allow sorting=true.They become clickable only if i make autogenerate columns=true. What can be the problem????
Thanks in adv!!!
|
|
|
|
|
Check whether you have assigned value in the SortExpression of each BoundColumns.
SortExpression might be the column name which is use to sort the GridView.
|
|
|
|
|
<blockquote class="FQ"><div class="FQA"> Venkatesh Mookkan wrote:</div>Check whether you have assigned value in the SortExpression of each BoundColumns.
SortExpression might be the column name which is use to sort the GridView.
</blockquote>
I haven`t explicitly specified the sortexpression in the .aspx page.
for your reference i m giving you the code
Sub FillGrid()
cmd = New SqlCommand
cmd.Connection = con
cmd.CommandText = "List_Party_Info"
cmd.CommandType = CommandType.StoredProcedure
sda = New SqlDataAdapter
sda.SelectCommand = cmd
ds = New DataSet
sda.Fill(ds)
CustGrid.DataSource = ds
CustGrid.DataBind()
Session("Data") = ds
ValidateGrid()
End Sub
above code is used for binding the grid
and the following is the sort command
Private Sub CustGrid_SortCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridSortCommandEventArgs) Handles CustGrid.SortCommand
Dim ds1 As DataSet = CType(Session("Data"), DataSet)
Dim dv As DataView = ds1.Tables(0).DefaultView
dv.Sort = e.SortExpression
FillGrid()
End Sub
Html Code
<asp:datagrid id="CustGrid" CssClass="datagrid" Runat="server" cellpadding="4" bordercolor="#EFEFEF"
AutoGenerateColumns="False" AllowSorting="True">
<AlternatingItemStyle CssClass="datagrid_row"></AlternatingItemStyle>
<ItemStyle CssClass="datagrid_row1"></ItemStyle>
<HeaderStyle CssClass="datagrid_heading"></HeaderStyle>
<Columns>
<asp:BoundColumn Visible="False" DataField="PARTY_CODE" HeaderText="Code"></asp:BoundColumn>
<asp:BoundColumn DataField="_XXXX" HeaderText="Bill Unit"></asp:BoundColumn>
<asp:BoundColumn DataField="YYYY" HeaderText="Name"></asp:BoundColumn>
<asp:BoundColumn DataField="ZZZZZZ" HeaderText="Role"></asp:BoundColumn>
</Columns>
<PagerStyle Mode="NumericPages"></PagerStyle>
</asp:datagrid>
but this event doesn`t fire..Whate can be the problem???
|
|
|
|
|
As I already told you, SortExpression is the problem. Please define SortExpression for the BoundColumns to which you want Sort option.
|
|
|
|
|
hi i am using c# asp.net visual studio 2005
currently i got a gridview which the data is population promically during the pageload
when i try to change the property of allowsorting to true and test it there is always error when the sorting is being clicked
anyone know why and how to fix this?
modified on Friday, January 18, 2008 5:57:47 AM
|
|
|
|
|
neodeaths wrote: when i try to change the property of allowsorting to true and test it there is always error when the sorting is being clicked
You should handle the Sorting event of the GridView. I am sure, you are not handling that event.
|
|
|
|
|
on accessing session on client side i got follwin error
this expression cause side effect and will not be evaluated error
Gaurav
|
|
|
|
|
How are you accessing the session on the client side?
|
|
|
|
|
|
This is not on the client side - still server side code. Where do you set up your session_name variable? Is there any other information with the exception?
|
|
|
|
|
what is the server side code and client side code where it has to use
sanjeev
|
|
|
|
|
hi,
I have this problem, when I work on my project at work, I usually modify in the xsd file in Visual Studio 2005. I add new stored procedures and stuff like that and they are reflected normally in the database on Sql server.
but when I try to continue my work at home, I fail to refresh my database on my sql server on my home machine, according to the new modified xsd file. I don't want to copy the database from my work pc to my home pc. They both have the same name. So I usually expect it'll work ok and the sql server would detect the changes I made and refresh the database accordingly..how do I manage to do that?
I need to know, cause that would be important when I deploy my web application afterwards..I don't want to take a copy of the database on the server and update on it?
Can someone help?
|
|
|
|
|
in my database there is a numeric type of column , there in the tabe it shows the values in the following format
1
2
3
4
now when i switch over to the crystal reports , the cross tab crystal reports , that numeric field prevents me to format(when i right click o it, if it is a cross tab).
actuallly it shows the data in the following way
1.00
2.00
3.00
4.00
i think i can use the formula fields , can somebody tell me how to use that to strip off the .00 part, or any alternate?
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|