Shared A Chronometer For All Users In C# (put Information In Cache Or Database)
Jun 1, 2010
I'm developing an application using ASP.Net.
For first the idea: "My WebApp needs an chronometerto be shared by users and all users will se the same value in cronometer. When a user clicks on a button, the cronometer needs to be restarted and all users will need to see that!"
All right, now I'd like to know what's the best choose to improve more performace an make sure that all users will see the same value in chronometer?
Need I use JSon (with jquery in client side), Timer with UpdatePanel of Ajax Extensions, pure Ajax (with JQuery) how to shared a cronometer for all users in C# (put information in Cache or database) ?
I have several web applications on a server using the same application pool. The worker process usually takes a lot of ram but usually only from one application. I can successfully limit the cache usage by setting "PrivateBytesLimit" in web.config file when the application uses it own dedicated application pool.
Does anyone know how this setting will be applied when using shared application pool? Is it per application, per worker process or per application pool? Also if it is not per application which setting from which application will be applied?
For reasons I would rather not discuss, I need to create a custom authentication system for my app. I was just reviewing the system and am having some doubts if my solution is thread safe. My goal was to create a solution that would allow my app to authenticate a user one time and that users authentication info would be shared by all master pages, pages, classes, user controls, etc that are used. (But not share the same info between users) Here is my setup: PageHttpModule.cs - this is added to the web.config as a httpModule.
public class PageHttpModule : IHttpModule { public void Init(HttpApplication app) { app.AuthenticateRequest += new EventHandler(OnAuthenticateRequest); } public void OnAuthenticateRequest(Object s, EventArgs e) { CurrentUser.Initialize(); } public void Dispose() { } } CurrentUser.cs public static class CurrentUser { public static bool IsAuthenticated { get; private set; } public static string Email {get; set;} public static string RealName {get; set; public static string UserId {get; set;} public static void Initialize() { CurrentUser.AuthenticateUser(); } Note: this is a scaled down version of my authentication code. public static void AuthenticateUser() { UserAuthentication user = new UserAuthentication(); user.AuthenticateUser(); if (user.IsAuthenticated) { CurrentUser.IsAuthenticated = true; CurrentUser.UserId = user.UserId; CurrentUser.Email = user.Email; CurrentUser.RealName = user.RealName; } } } UserAuthentication.cs public class UserAuthentication { public string Email { get; set; } public string RealName { get; set; } public string UserId { get; set; } public bool IsAuthenticated { get; private set; } public UserAuthentication() { IsAuthenticated = false; Email = String.Empty; RealName = String.Empty; UserId = String.Empty; } public void AuthenticateUser() { //do some logic here.. if the user is ok then IsAuthenticated = true Email = address from db UserId = userid from db; Realname = name from db; } }
I have tested between 3 different browsers and it seems to work fine, but I am still learning and don't want to make a huge mistake. If my logic is totally wrong, then how should I do it so I dont have to put user lookups on every page directly?
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?
I am creating a graphical tool in silverlight which reads data from multiple files and database.
i dont want to call the database again and again. i want to retrieve the data when required and keep it safe somewhere so if the user or any other user visits the same page, they can then access the data.
i want to use application state of asp.net Cache["Object"] but in Silverlight? what is the best methodolgy?
Is there an easy way to cache ASP.NET whole page for anonymous users only (forms authentication used)?
Context: I'm making a website where pages displayed to anonymous users are mostly completely static, but the same pages displayed for logged-in users are not.
Of course I can do this by hand through code behind, but I thought there might be a better/easier/faster way.
I am new to MVC. I am trying to write a simple web app - for learning purposes only, that allows multiple users to log in and enter their top 10 favorite movies. Each user can only see and edit their own list. The can have no knowledge of the other users or their lists.In regular ASP.Net I would do somthing like a session variable to store the user id so I could use it to test against the database and return that users information. I as I understand it that is not the way things are done in MVC. My question is how would I do this in MVC?
i'm developing a "small" warehouse-management WebApplication for few users(5-10 parralel) but with a complex authorization system(checking if pages,menus,TabPanels, UserControls and even single controls are visible or enabled) and permanent and frequent access. Because i've only limited experiences with the ASP.Net MembershipProvider, i'm unsure what's the best approach for following goal:
I want to hold all users, roles and frequently used masterdata in the Cache(in a Dataset). Hence every readonly access should be faster and causes less traffic than always using the database. On updates,deletes and inserts i would update the cached dataset and also the database.Can i use or extend the SqlMembershipProvider to achieve this goal and if possible how?Should i use the stored-procedures from asp.net or simply use the standard CreateUser, GetUser, DeleteUser-functionality? Does this approach makes sense at all?
how I can correct an error. I've built the MVCMusicStore tutorial here:
http://mike-ciccone.com/Store/
The first time I visit the site and attempt a database connection I get this error:
Exception Details: System.Data.SqlClient.SqlException: CREATE DATABASE permission denied in database 'master'.
But when I refresh, it all works fine. I'm at a bit of a loss. I don't believe I'm attempting to create a database, but I realise that the error may not really have anything to do with that. This is hosted at GoDaddy shared hosting. The database was created and I used an SQL script to create the tables initially and populate the data. My connection string works as I can pull data from the database, but I do have a feeling it will be a web.config setting that will correct this.
I am useing asp.net membership to store my users and under each users profile there is a field for their supervisor. I would like to get a list of all the users with the supervisor "Jon Doe". Is there an easy way to do this or would I just have to loop through each user and see if there supervisor = "Jon Doe" then if it is store there username in a list?
I have an ASP.Net 4.0 web application which very frequently loads data from the database and does heavy calculations on it. I want to cache this loaded and prepared data in a central cache that can be accessed by every user and computer who uses the application.
Simple use-case:
User 1 accesses webpage, cache is empty, data is loaded/calculated, data is cached User 2 accesses webpage, cache contains data, data loaded from cache User 3 accesses webpage, cache contains data, data loaded from cache User 1 reloads webpage, cache contains data, data loaded from cache Cache expires User 3 refreshes webpage, cache is empty, data is loaded/calculated, data is cached
I know that ASP.Net has a built-in cache mechanism. What I don't know is whether it can be shared between different users accessing the site on different computer at the same time. I would also like to know how the system behaves in a web farm environment.
I have been searching all over for this and trying many different things but so far have had no luck. I need to display the profile information for [all] users in the system within a GridView. For instance, I want to show their Username, First Name, Last Name,Email, etc.I've tried the Profilemanager.GetAllProfiles() method but t doesn't seem to have the fields in it.
I've a code to persist information in cookies about users like UserName and password.
Question is:
Its not secure to store information like that plain text in cookies.My DB store hashed passwords,so i could save those hashs in cookies and retrieve them later,but if i do that i wouldnt be able to fill password's textbox cause the hash string would be too long for it.
I've made a website online that allows customers to place an order. I would like the information customers input on the website to show once the customer clicks submit to confirm what was entered.
I am currently working on an ASP.NET 3.5 and C# web application which deals with users private information like SSN numbers. What are some of the security measures which I need to take from an application development stand point to feel safe?
I have a E-Shop Site and I need some customization for my users like following :
Store favorite products in their own basket.Customize products list in order to what are their favorite. It must remember their basket next time they want to visit our site.
my question is how I can store information for my customers who are new to my web site also most of customers don't like to have username and password then login first they like to buy during a week and at the end of week pay for them then we can send some products to their locations.
I have already written my application using asp.net with framework 4.0.
Im very new to ASP.net and have no experience with it at all.Im currently developing a website,and am confused about creating users.Im using the create user wizard,everything is working fine.However,I am worried about the security of user information.I believe the user information is stored in the APP_Data folder, am I right in believing that this folder is secure?
Exactly how is the user information stored when using the create a user wizard?In a database in the APP_Data folder?Is it encrypted automatically when a user signs up?
I recently developed a Java Application for a client with MySQL database. Now he wants to have ASP.NET website connected with the Java Application. I'm thinking of placing the database on a local server which would support both the desktop application and the website. What i want to know is, is it the good way to handle these kind of scenario or is there any standard method?
I'm wanting to use DB4o on an asp.net MVC project i'm working on but wondering if anyone has got this working on shared hosting plan, have contacted discountasp and asked them and they said go to the forum as they were not sure if they supported it or not or any configuration that would be needed. but the forum wont let my post on because its all filtered to only show comments they like the look of? anyone had any joy with this with another host and one that runs asp.net MVC as it should be run?
I need to restore the database daily. I have a BAK file in shared folder. I have to restore it from my machine. I have used the below script to restore the database but I am unable to restore it. Its throwing error. I have shown the script and error what I got when I execute my Store procedure.