Web Development - How To Disable OutputCache For Only One UserControl On A Page

Feb 3, 2011

i am using OutputCache on a ASP.NET Page. I set it programmatically like this in my Page_Load:

Response.AddFileDependency(cachefilepath);
Response.Cache.SetExpires(DateTime.Now.AddHours(12));
Response.Cache.SetCacheability(HttpCacheability.Server);
Response.Cache.SetValidUntilExpires(true);
Response.Cache.SetSlidingExpiration(false);
Response.Cache.VaryByParams["*"] = true;

Now the Page will be cached and this works fine. But i have one UserControl on the Page which shouldn't be cached. Is it possbile to disable Caching for this UserControl although the whole Page is getting cached?

The reason is that the output of this UserControl has two states and so can be different for each client according to his actions...

View 1 Replies


Similar Messages:

Disable OutputCache On Development System?

May 7, 2010

I use OutputCache in an ASP.net MVC application. As developing with an active OutputCache is not very pleasant I want to disable the OutputCache on the Development Systems (local machines and development server).

View 1 Replies

C# - Disable The Controls In A Page When The Usercontrol Is Selected?

Dec 11, 2010

I Successfully created an user control for displaying Error message. now everything works fine but when the message is shown the background controls can be accessed. how to disable the page controls or page from clicking or selecting any controls. and when the message panel is closed it should enable the page controls.i found the answer friends.

void DisableControls(Control parent, bool status)
{
foreach (Control c in parent.Controls)

[code]...

View 4 Replies

.net - OutputCache For Page Which Contains Shopping Cart?

Apr 2, 2011

I have a master page where in one ContentPlaceHolder I put my shopping cart:

<asp:ContentPlaceHolder ID="continutMeniuContulMeu" runat="server">
asp:UpdatePanel runat="server" ID="updatePanelCos" UpdateMode="Conditional">
<ContentTemplate>
<user:ShoppingCart ID="shoppingCartControl" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
</asp:ContentPlaceHolder>

View 1 Replies

OutputCache Page Directive To Improve Performance Of The Site

May 14, 2010

I am having trouble with the performance of a web site... Some SQL queries are killing the server. But, as the title of this post mention, I looked at the OutputCache page directive to improve performance of the site. Although, I came across some questions regarding this directive:

1- If I have a web-user control that declares an OuputCache directive in a page that has one too, which one will "win"?

2- What's the best pratice regarding the duration ? I'd love to have a sliding window too.

View 2 Replies

How To Disable Usercontrol Postback If Javascript Is Enabled

Oct 20, 2010

I've searched high and low for some resolution to this problem. Hopefully someone here can explain!!I create a usercontrol that uses .NET web controls, but I want to create a smoother user experience by avoiding full postbacks, so I write some JQUERY to capture click events on the client and in this way do the processing without going back to the server.

$("#tblLedgerEntries :checkbox").click(function () {
var value1 = $(this).closest("tr").find("td.invoiceAmount").html();
var value2 = $('#<%=hdnTotalToPay.ClientID%>').html();
CalculateTotalPayable(value1, value2, $(this).attr("checked"));
[code]...

View 2 Replies

Is It Wise To Mix MVC Development And Web Form Development In The Same Group Of Products?

Oct 20, 2010

We have a largely asp.net web form team (With some Oracle developers thrown in).

Question 1:

Is it a good idea to start using asp.net MVC which will mean redevelopment of a number of standard controls for not much benefit.

Question 2:

Is it a good idea to hire developers where there most recent skills are with asp.net MVC?

I doubt there is any benefit adopting MVC now, given the 100+ applications in this suite of products, and the maintenance/rework this will cause. Given this, is there any particular reason to hire MVC developers, as they won't be hitting the ground running, which is what I need now.

View 3 Replies

User Controls :: Call Function In Master Page From UserControl In Content Page

Jan 25, 2014

On MasterPage i have function below, how call this function on test.ascx  form on button click.

public void HideBtnLogin() { string session = Session["userCode"] as string; if (String.IsNullOrEmpty(session)) {
lbtnSignInTop.Visible = true; lbtnSignUp.Visible = true;
}
else { lbtnSignInTop.Visible = false; lbtnSignUp.Visible = false; } }

View 1 Replies

User Controls :: How To Call Event Of Button Inside UserControl In Master Page From Content Page

Apr 25, 2014

I have a ShoppingCart UserControl on MasterPage. I have a following functionality: User adds item to the cart. after clicking the button "Complete Sale" in UserControl the page is redirected to "CustomerInfo.aspx" and after filling the Customer information and clicking on submit which is on CustomerInfo.aspx page i want to call the "Complete Sale" click event of UserControl from "Customerinfo.aspx" page.

Customerinfo.aspx.cs
protectedvoid btnSubmit_Click(object sender, EventArgs e)
{
try
{
bool val = false; int retVal = 0;
CustomerBiz objCust = newCustomerBiz();
objCust.FirstName = txtFirstName.Text.Trim();

[code].....

Here the Button text changes in UserControl. But i am not able to call the Click event of this button from CustomerInfo.aspx (ContentPage)?

View 1 Replies

User Controls :: Find And Access Master Page Control From UserControl Inside Content Page

Jan 24, 2014

On masterPage i have button btnTest, how hide button from masterPage on userControl.ascx

example:  

btnSecondPage_click
{
   btnTest.visible = false;
}

View 1 Replies

Web Forms :: What Is The Use Of OutputCache

Oct 5, 2010

<%@ OutputCache Location="None" VaryByParam="None" %>

Because when am using this line in http then the attachment is opening fine but not for https.But after removing this line then https is working fine.

View 6 Replies

C# - Using Outputcache Together With Urlrewriting

Mar 31, 2011

I've got a problem using outputcache together with urlrewriting. We've got an application that rewrites url (IE [URL]). Based on the URL (/about/) we figure out which content to show. Now we're trying to add outputcache to that page:

< %@ outputcache duration="600" location="Server" varybyparam="Custom" varybycustom="RawURL" %>

And in the Global.asax we override GetVaryByCustomString like below:

public override string GetVaryByCustomString(HttpContext context, string custom)
{
if (custom == "RawUrl")
{
return context.Request.RawUrl;
}
else
{
return string.Empty;
}
}

However, when we publish the page i'd like to invalidate the cache so that the editors see the change directly. But no matter what I try, I cannot seem to invalidate the cache. If I'd like to invalidate "/about/" I would like to do this: HttpResponse.RemoveOutputCacheItem("/about/"); That doesn't work unfortunately. The only thing that seems to work is: HttpResponse.RemoveOutputCacheItem("/page.aspx");

This clears the cache for all my pages, not just "/about/". Is there any way to invalidate the cache based on the url? Or should we provide a cache key or something per page to be able to invalidate the cache programmatically?

View 1 Replies

MVC :: OutputCache / RenderAction And SEO?

Jan 29, 2010

I read many posts about outputcaching element in asp .net MVC, but i have one question.My architecture is :1 master page, 1 page (especially news information), and a few other controls like LogOnUser / Fixed status bar etc...I want to have my news cached cause there are three query to entities, but i need too the title for SEO of my master page (title is included in a contentplaceholder in master).I tried to use renderaction outputcache but it is not possible to retrieve the title from the renderaction. Have you any idea about this problem ?Maybe it's preferable to use a general outputcache and use a substitute from dynamic data, but i don't know if it's a best practice or not.

View 1 Replies

Calling Page Methods Of UserControl / Page Using MSAJax?

Apr 9, 2010

Is it possible to call usercontrol methods/events using MSAJAX. I wanted to update my usercontrol by calling one of its events when a property from its parent page changes.

View 2 Replies

Custom Development Versus CMS Development

Jul 16, 2010

I am planning to develop a social networking website for student of a particular university with following facilities.

Forum, Blog, Creating profile, creating groups , Adding Friends, managing groups, dating, chatting etc.

Now if I start developing it from scratch, this will take a lot of time..

I couldnt find any CMS which can in developing social networking website.

Additionally, I would like the website to have my own custom design. Also it should have support for AJAX, SEO and integrating third party applications.

View 3 Replies

Desktop Development Versus Web Development

Sep 13, 2010

How do you know what is better to use for writing new programs? We are now using Access 2007 frontend with an SQL backend and we are going to VB.Net, what would be our next logical step?

View 4 Replies

How To Invalidate The OutputCache In A Webform

May 3, 2010

i've got a website that uses OutputCache attribute to cache pages. Works great.

Now, I'm in the middle of R&D'ing scaling up this site to be in a web farm. Along with the usual suspects for webfarm pain ... I've noticed (pretty quickly/obviously) that the OutputCache from Server_A doesn't invalidate the OutputCache from Server_B .. if a try and invalidate a single server's OutputCache. This makes total sense -> how can S_A 'tell' S_B to invalidate when they are physically 2 seperate machines, etc?

So - what are our options?

Velocity? I understand this will move the caching to a different layer .. which means that the final result (output) will always be required to be determined .. as opposed to the OutputCache whic remembers the final output content (yes, varby gives different versions, etc.. which is totally fine). So even though the poco or business objects are all sync'd, there's still that last rendering effort required (even if it's tiny .. compared to the effort to generate/sync business objects).

View 2 Replies

Web Forms :: Set OutputCache Dynamicllly?

Feb 15, 2011

i have CMS that dynamically add user control to page. now i wanna use OutputCache for user control and set it from server side code. how i can do that?

View 1 Replies

MVC :: OutputCache Varyby IsAjaxRequest?

Jan 11, 2010

I've an action in a controller that returns different content if the request is Ajax or not:

[Code]....

So, from the view I can fill a <div> with the PartialView (RenderPartial), calling the same action (allowing javascript disabled clients). The problem is the cache, because when the request has cached as a normal request, if later sends the request as an Ajax request, the view is rendered very bad.

The question is: Is there any way to use OutputCache to allow to cache in different entries this two types of requests (Ajax and not Ajax).

View 4 Replies

AJAX :: ModalPopupExtender With OutputCache

Mar 1, 2011

I have a user control with OutputCache set to vary by any param (*). This user control has a LinkButton, which when clicked, causes a postback, and displays a ModalPopupExtender (the extender's TargetControlID is a dummy link). The user control is included on an aspx page.

The LinkButton is displaying the popup just fine. But if I open another browser tab/window/type, the LinkButton fails to generate the popup. I've tried (all separately):

moving the popup extender and its associated control to the main aspx page use OutputCache Location="None" on main page dynamically create the Popup extender and its associated control in Page_Init of both ascx and aspx

View 2 Replies

C# - Enable OutputCache With An IHttpHandler?

Apr 22, 2010

I have an IHttpHandler that I would like to hook into the OutputCache support so I can offload cached data to the IIS kernel. I know MVC must do this somehow, I found this in OutputCacheAttribute:

public override void OnResultExecuting(ResultExecutingContext filterContext) {
if (filterContext == null) {
throw new ArgumentNullException("filterContext");
}

[Code]....

View 1 Replies

MVC :: OutputCache'ing With Multiple Languages?

Mar 8, 2010

I'm looking into using the OutputCache-attribute for my ASP.NET MVC website. However, my website is using resources (*.res-files) to display two different languages (based on the user's settings in a cookie and/or database setting). Is there any way I can cache actions for my two languages separately?

Setting a "VaryByHeader" isn't gonna cut it since I have lots of visitors so every second visitor has probably another language set than the visitor before him. This would cause the cached action/page to always be updated since it's a different language.

View 5 Replies

OutputCache - Cache Only If No Params In GET?

Jan 23, 2011

What parameters to use in OutputCache if you want to Cache in case of no params on a page, in other cases not caching?

View 1 Replies

WebMatrix :: Web Development 101: Part 6 - Creating An Add Data Page

Mar 22, 2011

I've followed this training without problem until Part 6. When I get to the last execise on the page "Adding to the Database" my form does not work as expected. Here's the code for my AddMovie.cshtml:

@{
var MovieName="";
var MovieGenre="";
var MovieYear="";
if(IsPost){
MovieName=Request["formName"];
MovieGenre=Request["formGenre"];
MovieYear=Request["formYear"];
var SQLINSERT = "INSERT INTO Favorites (Name, Genre, ReleaseYear) VALUES (@0, @1, @2)";
var db = Database.Open("Movies");
db.Execute(SQLINSERT, MovieName, MovieGenre, MovieYear);
Response.Redirect("dataMovies.cshtml");
}
}
<h1>Add a New Movie to the database</h1
<form action="" method="post">
<p>Name:<input type="text" name="formName" /></p>
<p>Genre:<input type="text" name="formGenre" /></p>
<p>Year:<input type="text" name="formYear" /></p>
<p><input type="submit" value="Add Movie" /></p>
</form>

I get the Add Movie submit button, and I've rechecked several times, but I cannot find why 1) the data is not added to the database and 2) that the redirect does not send me back to the start page dataMovies.cshtml (which is working fine).

View 4 Replies

Visual Studio :: Shows Blank Page During Web Development?

Jun 26, 2010

I just upgraded a web project from VS2008 to VS2010 Ultimate (Windows7 64bit, IE8/Google Chrome. When I run the web project in the development server (by hitting F5) everything acts like it is supposed to except everything comes up blank. Even the directory structure page is blank, just an empty HTML open and close shell. I get no errors no indications of failure, nothing. When I try to use google chrome I get the same blank page no matter where I navigate to, even if I try to navigate to a non-existant location on the dev server. I know the code compiles and acts correctly because I can deploy it to our QA servers without issue.

View 2 Replies







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