Web Forms :: Server Control Private Cache And Application Variables
Feb 19, 2010
I'm developing a server control and I'd like to set some cache and application level variables but I don't want them to be visible from outside the control. Is this possible?
View 1 Replies
Similar Messages:
Sep 1, 2010
In an ASP.NET web app written in VB.NET, I need to load and store a large read-only hash table that is frequently accessed by the application. It only needs to be loaded once on application start, is never updated and can be accessed by any session at any time.
If I load the hash table into a private member in a (global) module, a lookup to it takes one 20th of the time compared to storing the hash table in the Application or Cache object. Is there any reason why I should not do this, or should Application or Cache always be used to store in-memory objects in an ASP.NET web application?
View 1 Replies
Feb 11, 2011
I have a server control that I developed which generates navigation based on a third party CMS API. Currently I am caching this control using the PartialCaching attribute. The CMS uses cache key dependencies to invalidate the cache when a user makes an edit, however in the case of my server control it does not get invalidated and the updated navigation will not show up until the cache expiration set by the PartialCaching attribute.Here is my two part question:
What is the proper way to programmatically cache a server control, without using the PartialCaching attribute, and adding a cache key dependency?
Is it possible to continue to use the PartialCaching attribute and add a cache key dependency?
View 2 Replies
May 28, 2010
In page behind classes I am using a private and shared object (list<client> or just client) to temporary hold data coming from database or class library. This object is used temporarily to catch data and than to return, pass to some function or binding acontrol. 1st: Can this approach harm any way ? I couldnt analyse it but a thought was using such shared variables may replace data in it ?2nd: Please comment also on using such variables in BLL (to hold data coming from database) where new object of BLL class will be made everytime.
[Code]....
View 4 Replies
May 28, 2010
In page behind classes I am using a private and shared object and variables (list or just client or simplay int id) to temporary hold data coming from database or class library. This object is used temporarily to catch data and than to return, pass to some function or binding a control.1st: Can this approach harm any way ? I couldn't analyze it but a thought was using such shared variables may replace data in it when multiple users may be sending request at a time?
[code]...
View 2 Replies
Mar 11, 2011
How can I manually clear ASP.NET server cache related to a give application/web site like what can be done on IE to clear browser cache for a give domain? BTW, I am using II7.
View 2 Replies
Jan 14, 2010
Im building a image gallery which reads file from disk, create thumbnails on the fly and present them to the user. This works good, except the processing takes a bit time.
I then decided to cache the processed images using the ASP .NET Application Cache. When a image is processed I add the byte[] stream to the cache. As far as I know this is beeing saved into the system memory. And this is working perfect, the loading of the page is much faster.
My question is if there are thousands of images which gets cached in the Application Cache, will that affect the server performance in any way?
View 3 Replies
Dec 15, 2010
I need to access post and get variables inside a server control class, there is no access to Request object in server control class...
View 1 Replies
Feb 26, 2010
I've got a web application that runs of a state server. It looks like soon it may need to distributed and there will be two web servers behind a load balancer.
This works great for session state but my next challenge is Cache
My application leverages heavily of cache. I understand ASP.Net 4.0 will be offering more here but nothing much has been said about the how too.
There are two challenges that I face
1). Each webserver will have its own copy of cache whereas it would be more efficient to put this to a third server the same as session state is put to state server.
2). The real challenge is keeping cache in sync if a simple dataset derived from the database is changed my code dumps that cache item and reloads the cache. That's all well on one webserver but webserver number two wont know to drop that particular cache item and reload it. This could cause some unexpected problems in the application.
For scenario number 2 I could attempt to do some smart coding so server number two knows to dump the cache and reload it.
My guess is someone else has already been here before and there's probably a better implementation approach rather than writing extra code.
Does anyone know how I could achieve the goal of keeping Cache in sync between multiple webservers or even better farm Cache management to another server?
View 2 Replies
Jan 11, 2011
Be built an MVC application. Some of the pages require being under SSL encryption. Means the whole site need to be broken down to sections (http and https)The immediate solution that comes to my mind is creating two IIS sites (port 80 and 443) and break the application to two sites (public-http and private-https). Since the site is complex, breaking it into two applications will be huge work.What is the easiest way of doing this?Is there any link or article that explains the best practices doing this?
View 1 Replies
Sep 5, 2012
I want to develope web based chat application for an organization
My requirements are,
1. Group chat
2. Private chat
3. All chat information will save in sql server
4. if user minimize the browser,it will blink like gtalk and face book
View 1 Replies
May 29, 2010
I want to use SQL Server based Cache dependency without data source control.How can I do it?I am binding data to grid through code.
View 5 Replies
Oct 6, 2010
i am developing a website in asp.net i have created a class "Utility" in App_Code Folder this class contains a static object of another class(LoginInfo) as described below:
[Code]....
This LoginInfo Class is my business object which only contains 2 properties UserID and UserName
Now what i am doing on my login page, after user authentication i am setting these properties with current logged in UserId and UserName
[Code]....
I am using this CurrentUser object on my webpage to get userid and username. It works fine, but after few minutes my CurrentUser.UserID and CurrentUser.UserName is set to blank string. I am not able to figure out what is the problem. may be due to asp.net recycles.
View 3 Replies
Nov 10, 2010
I'm using the OutputCache for my pages, and I have a dynamic user control (login/register) . When the user try to sign in, the the control do not change the aspect because I´m using OutputCache. How can I exclude the "login/register" control from the cache?
View 6 Replies
Feb 13, 2011
Does anyone know ...best reliable windows Virtual Private Server providers for reasonable price?I m currently with Godaddy and I m not happy with their customer support.
View 1 Replies
Apr 2, 2010
I am part of a team that is developing a SharePoint web part. My task is to create a user control which will ultimately be wrapped in another class for presentation in a web part. Because of these requirements, I must fit all of my code in a single user control.To organize my code in the code-behind, I created a few private classes for the different objects which are represented in the database. I want to add some exception handling whereby if some sort of DB exception is thrown I can update a message on the page informing the user of the problem.
My problem is that the page-level controls are inaccessible from the private class where I'm issuing the query, so even if I catch the exception I have no way of directly accessing a Label control to populate the error. I tried to create a baseclass with an EventHandler defined, but when I throw events from the private class I'm not able to catch them for whatever reason. I'm far from an OOP expert Here is a snippet:
ASP Code:
using System;
using System.Collections;
[code]....
View 3 Replies
Oct 26, 2010
If I have a 2 control load events and one page load event subs and the control1_Load events fires first, can I lookup some database things and persist them? I would like to use the persisted data in the other two events when they fire. Normally I've been using session variables , is there a better way?
View 3 Replies
Apr 5, 2010
I am creating a custom control to fix an issue with the asp.net Linkbutton control not working with the Enter key on Firefox. Here is the .ascx file, my custom control is the last registered:
XmodDisplay.ascx
<%@ Register TagPrefix="xmc" Namespace="KnowBetter.XMod.Controls.Template" Assembly="KnowBetter.XMod" %>
<%@ Register TagPrefix="xmuc" TagName="Pager" Src="~/DesktopModules/XMod/Pager.ascx" %>
[code]...
View 1 Replies
Jan 22, 2010
I have recently moved our ASP.NET session state from InProc to a Sql Server solution. I can see session data being inserted into the Sql Server database. I'm monitoring the w3wp.exe process using the "Private bytes" & "# Bytes in all heaps" performance counters.As I navigate through the website it places data into session, however the private bytes counter still climbs on the server hosting the website? I thought the session data was being written to the database and not being stored in memory? The managed bytes remain constant, and I'm pretty sure all the objects going into the session are managed types.
View 1 Replies
Aug 16, 2010
I have set Private Memory limit of 200mb in IIS 7 for an application pool. The Private Working Set memory(Task Manager) for the application is always below 125mb but the number of page faults have increased a lot and application cache is getting cleared frequently after setting the limit.
I haven't set any limit on Virtual Memory.why the cache is getting cleared even when the Private memory used is below the allocated memory?
View 1 Replies
Jan 26, 2011
I cant figure out how to use the Application["myvar"] variable to store data for the application in asp.net 4.0 web app using c#. It say Application is not a known object and I can't for the life of me figure what to do a "using" on to expose it. I am in a static class at the time I cant use it. It seems to work in other units?
View 3 Replies
Aug 7, 2010
How do I store a variable or object application wide in ASP.net MVC. In regular ASP, you had the Application object, and in ASP.net too apparently.
View 1 Replies
Jun 10, 2010
I need to know what is Cache size. I've read solution on this site for more or less similar question but it partly serves me. As i know i can get values from PerMon, here is function
public static string getCacheSize()
{
PerformanceCounter pc = new PerformanceCounter("ASP.NET Applications", "Cache % Machine Memory Limit Used","__TOTAL__", true);
return string.Format("{0:0.00}%", pc.NextValue());
}
1.it gives me percents when i need KB and there is no item closest to this one in PerfMon
2.it shows 70.5% used while all memory usage is about 50%
View 1 Replies
May 16, 2010
This question actually refers to a classic ASP page I'm working on, but I'm assuming that app variables work the same in both ASP and ASP.NET Let's say we have a bunch of websites, owned by different people. The sites are all different, but the common theme is they are car enthusiast websites. Each of these websites has their own unique index page (of course), but also "common" pages, which are pages shared by all the websites.
One of the common pages, checks for the value of an application variable, which may or may not exist. For example, lets call this page luxurycars.asp, which is a simple page that shows the top 10 luxury cars of this year. This common luxury car page will pull and use the app variable like so:
[CODE]
Dim SiteOwner
SiteOwner = Application("OwnerName")
Response.Write("This site is managed by " & SiteOwner)
[/CODE]
This app variable is set uniquely in each clients index.asp page like so:
[CODE]
Application("OwnerName") = "John Doe"
[/CODE]
Will this work? I just started learning classic ASP (for my job), and I'm reading that application variables are universal and only one copy of the variable will exist. So does this mean if John Doe sets Application("OwnerName") to "John Doe" in HIS index.asp page, will everyone that visits the common luxury car page see John Doe's name? Regardless of whether they got to that page via John Doe's page or someone elses? And if so would using a Session variable instead solve this problem? Sorry if this sounds confusing, let me know if I need to re-word it or give more detail...
View 2 Replies
Mar 15, 2011
I store a large structure holding my application's reference data in a variable I access through HttpContext.Application. Every once in a while this data needs to change. When I update it in place, is there a danger that incoming requests will see the data in an inconsistent state? Is there a need (and a way) to lock some or all of this structure? Finally, are there other approaches to this problem other than querying the database every time you need this (mostly static) data?
View 3 Replies