.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

ASP.Net Caching problem ??

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

I'm having a problem with an asp.net 3.0 application using a gridview to display data.  The problem seems to be that despite a brand new .selectCommand being sent to the sqlDataSource, the gridview starts displaying data from *someone else's* query.  For example, user A is logged in and will be working fine until a few page submissions later when the gridview data starts suddenly showing information that belongs to another user. 

This is my first asp.net application, though I've been working with classic asp and ADO for years so I'm used to sending a SQL string and getting back the results from that string.  Apparently there is a complex caching system which is interferring which I do not at all understand so at this point I just want to stop the server from caching any data whatsoever.  Is this possible?

Any and all help will be much appreciated!!

View Complete Post

More Related Resource Links

image caching problem in internet explorer

i have built a custon aps.net image controls, which currently refresh the image via javascript and ajax.in firefox, google chrome,.. it works perfectly, but (suprise), there is problem in internet explorer 6 and 7. IE didn't relase the old (previous) image, so all images will be saved in the cache and ram consumption of the browser rises until it crashes...the javascript code:function getNextImage(clientId) { if (busy) { window.setTimeout("getNextImage('" + clientId + "')", 100); return false; } busy = true; //Send the request to server with the current image url as the argument var element = document.getElementById(clientId); var func = "CallServer(" + element.src + ", '')"; var sor = element.src; func = "CallServer" + clientId + "('" + sor + "', '')"; window.setTimeout(func, 0); } function ReceiveServerData(rValue) { //Receive server's response of a string rValue, which is prepared in the server's function //GetCallbackResult() var wds = rValue.split(";"); //Assign the transition effect var photo = document.getElementById(wds[0]); photo.style.filter = wds[2]; //Preload the image file from server. When finishing download, imageLoaded function will be called //with t

proactive caching, sql server notification problem

I'll explain the problem with this simple example. I have a dimension and a fact table: CREATE TABLE [dbo].[Lead_Dim](   [Id] [int] NOT NULL,   [LeadSource] [nvarchar](50) NULL,   CONSTRAINT [PK_Lead_Dim] PRIMARY KEY ([Id]) ) GO CREATE TABLE [dbo].[Lead_Fact](   [Id] [int] IDENTITY(1,1) NOT NULL,   [LeadAmount] [float] NULL,   [Lead_Id] [int] NULL,   CONSTRAINT [PK_Lead_Fact] PRIMARY KEY ([Id]),   CONSTRAINT [FK_Lead_Fact_Lead_Dim] FOREIGN KEY([Lead_Id]) REFERENCES [dbo].[Lead_Dim] ([Id]) ) GO In the cube, I've enabled proactive caching for dimension and measure group partition. I use SQL Server notification (tracking table is 'Lead_Dim' for dimension and 'Lead_Fact' for measure group partition). Other properties are set to default (silence interval 10s,...). When I insert a record in the dimension and a record in fact like this: DECLARE @LeadId INT SET @LeadId = 1 INSERT INTO [Testing].[dbo].[Lead_Dim] ([Id], [LeadSource]) VALUES (@LeadId, N'Agent') INSERT INTO [Testing].[dbo].[Lead_Fact] ([LeadAmount], [Lead_Id]) VALUES (1.2, @LeadId) GO proactive caching processes both dimension and partition and cube measure is refreshed. But, when I run this: DECLARE @LeadId INT SET @LeadId =2 INSERT INTO [Testing].[dbo].[Lead_Dim] ([Id], [LeadSource]) VALUES (@LeadId, N'Agent') WAITFOR DELAY '00:00:02' INSERT INTO [Testing].[

Sharepoint - Silverlight - caching problem


I have a Sharepoint 2007 site (Custom Template) . The data entry forms are created in Silverlight and host it on Sharepoint.

I use a User Control hosting webpart and host the XAPs.

To be in details : I place the XAP under _layouts. I create a user Control and place at _ControlTemplates and use a Object Tag in the User Control and refer to the XAP. Now on the Sharepoint page I add a (Custom) User COntrol hosting Webpart , refer the User Control (.ascx) , so that my XAp is hosted on the Sharepoint Site.

Problem Statement : I face a refresh problem when I deploy the XAP to _Layouts. When ever I deploy , if I replace my existing XAp with the latest XAP, the changes in the latest XAP are not being reflected immediately. i have to restart my Server for the latest XAp changes to be visible. Instead Ii am creating a new Folder in _layouts , every time I deploy the XAP and updating the reference path in the UserControl(.ascx) to this XAP, which works.

What is solution so that I dont create folders every time i deploy ? Can anyone please help. How can I get rid of this caching / history problem.

D V Suman Gupta

2008 reportviewer - IE9 beta caching problem



In IE9 beta the reportviewer is caching the previous report. I have a reportviewer on an aspx page that gets called and the code behind connects to the reportserver using the remote process mode.

However when the new tab opens up the old report is still displayed. This doesnt happen in IE7 or Firefox.

Anyone come across this problem?


new design caching problem


Salam to all,

i have a website and i run it from 1 year ago, its working with no issues,

now i make major changes on the code also i remove some other components for the website but i didnot upload it online yet,

i added some additional HTML tages, additional CSS class and  colors. what i am afraid from is when i upload the site online, the caching from the PC's and Providers maybe show the old design also the new tags maybe didnot get the correct classes (it will take the old one if exist), also the new Style Sheet files will not be run on the new website regarding to caching issues,

what is your advice to avoid ISP, PC's caching issues.


Problem to group radio button across gridview rows

In general no one can easily group or make a single selection from radio button list inside gridview rows. There are a lot of way to make a single or unique selection from list. Here i want to share how i can address this problem in the most easiest way. Googling the problem most of the cases i saw the grouping in horizontal way. Thats why i tried to group the radio buttons in vertical manner. Let i have a requirement like below:

Regrading Sharpoint 2010 problem and solutions

We can write your question and problem on this blogger.you get ans.use.

This sharpoint 2010 problem solving threads

Hi friend,

you can use this thread to solving problem and solutions.

Virtual Path Problem


 I get the following error on last line below (working on remote host): 'E:\web\sfcascom\ls_admin/uploads/images/001.JPG' is not a valid virtual path,

Note that the slashes go in different directions

I've tried a number of things but nothing seems to work. Thanks-


Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Drawing.Imaging
Imports System.Web.UI.WebControls

Imports System.Drawing.Imaging.ImageCodecInfo
Partial Class Protected_imageupload
    Inherits System.Web.UI.Page
    Private Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpload.Click
        ' Initialize variables
        Dim sSavePath As String
        Dim sThumbExtension As String
        Dim intThumbWidth As Integer
        Dim intThumbHeight As Integer
        Dim sFilename As String = ""
        ' Set constant values
        'sSavePath = "images/"
        sSavePath = Server.MapPath("~/") + "ls_admin/uploads/images/"

        sThumbExtension = "_thumb"
        intThumbWidth = 160
        intThumbHeight = 120

        ' If file field isn?t empty
        If FilUpload.PostedFile IsNot Nothing Then
            ' Check file size (mustn?t be 0)
            Dim myFile As Http

Strange Photo upload problem


I'm working project it's live on shared hosting

we'er uploading photos to a file on the server everything works fine the photo is resized renamed and sent to the folder

the upload page returns the thumbnail and the full size photo it's there all the photos have to be approved by an admin

twice now after they have been approved they disapear I checked the folder they are not there could there be anywhere

on the server they could get hung up before they go into the folder I have it setup so when you delete the data base entry it deletes the photo from the folder othe than that you need to open the folder and delete the photo this has hapened twice now I tried to recreate it with no luck

thaks for your help in advance

Could some one tell me whats the Problem with this String Manipulation ??? C#.net



I store some values from code behind to a label which is Hidden !

<asp:Label ID="lbl_Hidden" runat="server" Visible = "false"></asp:Label>

and at the page load event i retrieve the value of the label & assign it to a string !

stringvalue = lbl_Hidden.Text;

Now i dont know why this manipulation does'nt work !

I've a character 'A' in the string and i'm unable to replace it with a space !

stringvalue.Replace(A, " ");

Wot do u think abt it ????

RaiseEvent problem


I have a parent page ProdView.aspx and two static UserControls, UC1 and UC2. Each UC is in an Ajax accordion pane and the accordion inside an updatepanel.

UC1 has a Gridview footer with couple of textboxes and a link button that fires an Add Row insert procedure. I want to Raise an event that will rebind the UC2 after the row insert in UC1.

First I created the sub delegate and event in UC1:

  • Public Delegate Sub MyRefresh(ByVal sender As Object, ByVal e As CommandEventArgs)
  • Public Event Refresh_UC1 As MyRefresh

In the same UC1 the Insert procedure that fires the insert and RaiseEvent:

Sub PricingGrid_Insert(ByVal sender As System.Object, ByVal e As EventArgs)
       Dim myConn As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("LocalSqlServer").ConnectionString)
       Dim myCom As SqlCommand = New SqlCommand("AddRow", myConn)
       myCom.CommandText = "AddRow"
       myCom.CommandType = CommandType.StoredProcedure


Gridview Enable Selection Problem



I have a gridview with Enable selection and Enable Paging equals to TRUE.

I also set the PageSize of my gridview to 4 so that I only displays 4 rows per page.

The problem is when I click the pager in the bottom of my gridview, my gridview is disappearing and no records appear.

Here is code behind of my gridview:

If e.Row.RowType = DataControlRowType.DataRow Then
                e.Row.Attributes("style") = "cursor:pointer"

                e.Row.Cells(2).Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(sender, "Select$" & e.Row.RowIndex.ToString))
                e.Row.Cells(3).Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(sender, "Select$" & e.Row.RowIndex.ToString))
                e.Row.Cells(4).Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(sender, "Select$" & e.Row.RowIndex.ToString))
                e.Row.Cells(5).Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(sender, "Select$" & e.Row.RowIndex.ToString))
                e.Row.Cells(6).Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(sender, "Select$" & e.Row.RowIndex.ToString))

Problem making Role based Menu in MVC application



 I want to make Rolebase menu in MVC such that if user doesnot have permission for some action then that Action name shouldnot be shown in the Menu.

 I have used the code in the url(http://forums.asp.net/t/1566328.aspx) in my MVC application.My application is a Discussion Forum(in MVC) same functionality as in this forum forums.asp.net

 I have used Controllers for post, thread etc.In each controller there are some actions that are using [Authorize(Roles)] attribute

 but this coding does not count  those Actions in Controllers having Authorize attribute according to the url http://forums.asp.net/t/1566328.aspx 

 In the code, Authorize attribute is applied to Controller class, but my requirement is of Applying Authorize attribute to some actions in controller so that some are available for all users and  some links are available rolewise.Now what is the solution for that?



is the page caching?


I am just trying to understand the basics flow to the MVC framework by putting in some breakpoints in the beginning of the actions of a couple of controllers.

One break point is at the HomeController/Index action where it just returns View() of the "Welcome to MVC".  The Second break point is at a SecondController/Index action where it uses the Entity Framework and returns a View() of a list from the db.

When I run this in debug, it breaks at the points I expected when I go from Home page to the Second page controller and back to Home.  However, when I go to the Second page again, it doesn't break at all?  Is the results of the Second page being cached and how and where?  How do you trigger for it to get check if data is old?

I check to see if the persistence is done on the db, by changing the value of a field on the db side and it still did not cause it to break on that action and displays old information in the view.  I am concerned because it is displaying incorrect values on the UI.  I do not have the OutputCache attribute above this action or specified any cache on my web.config.

Thanks in advance for your time :)

Problem upgrading to MVC3 - System.Web.Routing



I'm trying to upgrade to .NET 4 and MVC 3.

When trying to compile my project, I get the error:

Error 1 The type or namespace name 'Routing' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) C:\Users\spencer\Desktop\weblauncher\Common\MVCConfig.cs 4 18 Common

The type or namespace name 'Routing' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)

I do have the System.Web.Routing in my references for the project.

BUT - when I try to view System.Web.Routing in the OBJECT BROWSER, nothing is inside!  The System.Web.Routing namespace is not in there - the entire thing is empty!  Could it that the dll is corrupted?  I tried to reinstall the .NET 4 and MVC 3 stuff, but its still empty!

The dll is coming from here:

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Web.Routing.dll

and the runti

Embed Youtube inside Ajax Html Editor- problem



When inserting a simple embed of youtube inside the ajax editor, on firefox and chrome problems occur. On the other hand on internet explorer 8 everything works fine. I found this solution http://www.nopcommerce.com/boards/t/4228/bug-in-ajax-html-editor.aspx . 

My question is where do I find the DesignPanel.pre.js ?


Roderick Vella

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend