.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

Caching multiple copies of a page

Posted By:      Posted Date: September 02, 2010    Points: 0   Category :ASP.Net
Hi Guys, I have  an aspx page that retrieves and processes an image based on a  query string.The whole operation takes about 2-3 seconds.  However as the nature of the images means they are quite static,a 5 min (or even 5 hour) delay in picking up an updated image is acceptable. Because of this delay I would like to cache the response and only do a proper refresh only periodically. I have added the following to the top of my aspx page.  <%@ OutputCache Location="Any" Duration="600" VaryByParam="*" %> Only the last request appears to be cached - i.e. f  I navigate to ../DisplayImage?ImageId=1Then the page is loaded and Image 1 displayed - subsequent requests are cached.If I navigate to ../DisplayImage?ImageId=2 subsequent requests are cached.However if I go image 1, image 2, image 1 then no caching occurs. I'm wondering if i'm missing something obvious or does IIS7 / ASP.NET just not support this type of caching.Any help would be greatly apreciated.Malachy

View Complete Post

More Related Resource Links

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 :)

Not getting multiple composite controls on master page


I have created two composite controls in the same assembly and registered that assembly in a master page using <%@ Register tag.

When I try to use these controls using the registered tag prefix I am getting only one control along with the tagprefix .

How to get all the composite controls present in the registered assembly?

Need help with partial page caching


I have a banner on the master page that I don't want cached even though some of the content pages are cached.  I'm using the adrotator control, which I know doesn't cache, but I have code in the AdCreated event, and that does cause it to cache.

I've been struggling with this for several days now.  I've tried putting the code in another page and using an iframe to display it.  This worked except at times what got displayed was the headers of a page within a page withing a page.  This would mysteriously come and go, but when it happened, it would crach browsers and it looked terrible. 

I'm thinking of using ajax, but I don't already have a scriptmanager control on the master page.  Before I remove the scriptmanager control from all the content pages, I'd like to try to use partial page caching.  I've Googled it, but I don't understand what I've read.  CAn someone simplify this for me?

Multiple forms on the same page MVC2: how to handle (including validation from model)



It should be simple; although I'm having a hard time to figure out the best way to do it. I've MVC2 pages with multiple forms on the same page having different functionalities.

What's the best way to handle this; including the MVC2 way of validation from the model?


Select All on multiple data grids on the same page

Hi gurus, I have two data grids on one page and both have first colums as a check box list. I want to implement a check All button for both the grids independently, now here is the problem I am using the following code to do that and even though I write individual functions for both the grids, when i check the Check All check box for grid one it checks everything on grid one as well as grid two. <HeaderStyle HorizontalAlign="Justify"> </HeaderStyle> <ItemStyle HorizontalAlign="Center" BackColor="Lime"> </ItemStyle> <HeaderTemplate> <asp:CheckBox ID="CheckAll" OnClick="javascript: return select_deselectAll (this.checked, this.id);" runat="server" /> <img src="../Images/email.GIF"> </HeaderTemplate> <script language="javascript"> //checks all DataGrid CheckBoxes with the given name with the given value function select_deselectAll (chkVal, idVal) { var frm = document.forms[0]; // Loop through all elements for (i=0; i<frm.length; i++) { // Look for our Header Template's Checkbox if (idVal.indexOf ('CheckAll') != -1) { // Check if main checkbox is checked, then select or deselect datagrid checkboxes if(chkVal == true) {

Multiple DataSets in One Page

Hi, I'm using SSRS 2005. I'm working on a SSRS that has three data set: one for client information display, the other for chart (graph) and third for Report Parameter to select Clients Name. Clients can have one of more facilities. The issue I'm running into is that when a user selects a client from the parameter, I get multiple facilities info for the client selected and and one Graph at the end. For example, if I have client ABC and client ABC has 3 facilities: Fac1, Fac2 and Fac3. The info for each facilities is displayed, but only one Graph is displayed at the end of the page; I understand this is because I'm using a List to display the info using a separate Dataset and a separate dataset for the chart. My question is there a way that facilities information and chart can be displaced on one page? For example, Fac1 information and the chart associated with it on one page and next page would be Fac2's info and chart and so on.

need to link multiple detailsview to page from one master detailsview

I am trying to arrange the information from a SQL record into a 3 column by 3 row table to fit  the form presentation that I want. I have placed on the page 3X3 table and then tried to place a detailsview in the first cell for the first picture called P1dv. I have place a detailsview in the last cell that would control the paging of information called Controldv. I need to fiqure out how to link P1dv paging to Controldv page action. I am using visual web dev. 2005. I am not updating or editing these are read only views.  All help is greatly appreciated.  example of what i need the form output to look like:     picture1   picture2  picture3     name1     name2     name3     Contact1   contact2  contact3what i have coded as of now:asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ContactConnectionString %>" SelectCommand="SELECT * FROM [driveinfo] ORDER BY [Updated_on] DESC"></asp:SqlDataSource>    <table style="width: 827px; height: 339px"> <tr> <td align="

multiple forms on single page

hi I've been going trough some of the tutorials on asp.net and decided join two of the tutorials.So I created a master page (menu.Master) containing a form and then derived a 'Web content form' from the master.On content page I added a server side form within the 'ContentPlaceHolder' area and now get an error. [HttpException (0x80004005): A page can have only one server-side Form tag.]I guess i'm doing something fundamentally wrong, could someone explain how it should be done . Thanks

Multiple instance of User Control on Page - Button Click Event

Hi, I have this Web User Control, with 3 controls:<asp:TextBox ID="txtSearch" runat="server" /> <asp:RequiredFieldValidator ID="rfvSearch" runat="server" ControlToValidate="txtSearch" Display="None" /> <asp:Button ID="btnSearch" runat="server" onclick="btnSearch_Click" /> In code behind: protected override void Render(HtmlTextWriter writer) { rfvSearch.ValidationGroup = this.ID + "_validation"; txtSearch.ValidationGroup = this.ID + "_validation"; btnSearch.ValidationGroup = this.ID + "_validation"; base.Render(writer); } protected void btnSearch_Click(object sender, EventArgs e) { Response.Redirect("ResultadoSearch.aspx?argumento=" + txtSearch.Text); } When I try to add two UserControl and I Click in btnSearch of second UserControl, txtSearch.txt returns value of first User control.How I can get the value of second txtSearch?

Multiple Tables on One Page, One Dataset



In SSRS 2005, is there a way to have 2 tables on a page, each displaying a row of data from the same dataset?

In other words:

Page 1, Table 1 data = row 1

Page 1, Table 2 data = row 2

---- new page ----

Page 2, Table 1 data = row 3

Page 2, Table 2 data = row 4

and so on?

Multiple Copies for Same Record


My records have a field 'count'. Let's say I have

rec1: count=1
rec2: count=2

Currently, when generating a report each record will generate one page, i.e. 2 pages for the above. However, for each record I want to create as many identical pages as indicated by count. So in the above example I would get three pages of which two are identical (for rec2). Well, identical except for the page count which also needs to be on each page, i.e. page 1 of 3, page 2 of 3, page 3 of 3. How do I achieve this?

Group report splitting into multiple pages Need it in 1 page


1) Few of my group reports which have more than 500 rows are splitting into many pages without column header. (eg, page 1, page 2... etc.) I would like configure it to be in one page however large it may be.

2) I tried setting column header in group reports which are splitting into multiple pages but its not working.

Either I need achieve point 1 or point 2

Could you please help me how to achieve it?


How do I add multiple instances of the wiki editor control to a page?


(Sharepoint 2007)

I have a SharePoint wiki site and the home page has become a bit cluttered. Using SharePoint Designer 2007 I have figured out how to edit the home page of the wiki site and I have created a row of tabs with associated content pieces. It's the usual thing, click on a tab, hide one div, show another. What I would like to do is to be able to edit each div's content as a separate wiki page. Is this possible? I currently have the SharePoint:FormField and SharePoint:ListFieldIterator tags commented out.

Thank you for any help you can give.

Error pop out when multiple EWA used in one page



I met one problem in SharePoint Designer 2010.

As my customer's requirement, I created a lot of PivotTables and PivotCharts in multiple sheets in one Excel file. Now I need to integrate all the PivotCharts in to one single page, all the PivotTable need to be show on the page at the same time, so I cannot use the named Item drop-down list.

for this requirement, I inserted a lot of Excel Web Access web parts in the page, all the EWAs connect to the same source file(the Excel file mentioned above) which has already located on SharePoint Server, then I am not able to open the page in browser(IE8).

It will show two kinds of information when failed to open the page:
1.It shows: The web page cannot be displayed.
2.The 2nd will show one dialogue asking for user credentials continuously.

Do you have any idea about it, or if you have other methods to make all the PivotChart show on the page simultaneously, please let me know.


Connie Zhu

How can I create multiple files all referencing the same aspx page?


 Basically I need multiple code-behind files each containing different functions for a page. Different classes do not do this because they are not connected to the page so their methods require parameters I want direct control of the page without the need for parameters.

I can only seem to crete one code-behind file and I need many. I've tried putting the aspx page in the App_Code folder but this causes an error.

Is there a way to do this?. Any help would be appreciated.

WCF - Entity Framework - POCO - Caching with multiple services



We have an architecture where we use Entity Framework with POCO, and the code-first approach (no edmx file). In order to explain the problem I have to explain a little bit about our architecture:

We have one layer which contains Routing Services (for load balancing and security), and a layer of Data Access Services. All services are hosted in IIS.

What we would like is to have caching of our (Entity Framework) Context, so we made the context static, and thought it would be shared between the different services. Well, it's not... 

The scenario (where we noticed the problem) was that we did some changes to an transaction through the Transaction services. We then did a search through the Search services, and found that the data wasn't updated. Well, actually the data are updated, and saved to the DB, it's just that the "Search Context" is out of sync. When retrieving the data from the Transaction service, we got the correct data, as expected.

So, after hours of googling I still haven't found a solution to the problem, and I'm hoping to get some response here.

Master Page/Content Page - Multiple Submit Buttons / ViewModels ? Best practise?



I wanted to ask, what would be the best mvc practice to get the following result:

I want to create a mvc website with one master page and several content pages.

There are some parts on the master page (besides the header and footer) on the left side, that should be available on every content page.

So I guess it makes sense to put that stuff inside the masterpage. These things are several panels. There is one panel with a search field and a search button. Another panel should retrieve data from an own viewmodel, that displays content related data to the user.... and there are another 2 similar panels.

So I thought I could create for those 4 "panels" 4 parial strongly typed views with their own ViewModels. Then implement them with RenderPartial on the Masterpage.

But I realized, that this causes a lot of problems in mvc. First I realized, that I am having problems that the viewmodels behind the partial views are different to the viewmodels of my content pages.

Then I realized that I have anyways problems with more than one submit button. I read now a lot of different solutions on similar cases and now I really dont know, what would be a very "pretty" solution for my case.

I think this is not something very rare that someone is having a searchbox with a search button shared for all pages, because I read

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