Way To Create A List - Simple Cache Implementation
Mar 16, 2010
I need to build up a List<object> and cache the list and be able to append to it. I also need to be able to blow it away easily and recreate it. What is a simple way to accomplish this?
We have a wfc layer that wraps the business classes and database access and use a client that lives on the database layer. Amongst our group we are attempting to form standards. Some want to have the client call the web method and pass the page they are requesting and the page size. Pass that to the database and then page in SQL Server use RowNum.Some want to cache the full list of objects in http cache on the service tier and page in memory. They concern here is memory use on the server.
Which would be best for a medium number of users with potentially large number of records to manage (say 30K) Is it better to cache them all in memory and work from there or page at the database as the application scales?
I have a List of objects in an asp.net page. when the page loads in the browser for the first time, I fetch data from the database, create objects with those data and populate the list. All these are done inside the page load event handler. Now when the page is posted back to the page, the previous list is gone, since the variables were all freed.
How can I cache that List, so that when this page is posted back, all my objects are available?
I need to create a simple blog feature for my website. I have created a form that writes to an XML File, i now need to be able to display this file in a blog style, and possible add comments.
I want to create a new module in DNN (VB) ... that;
1. does not use DAL or DAL+ 2. has only one view.ascx control 3. It has to be a compiled module
I do not need DB connectivity and any bells and whistles just one view control. I thought it would be simple but googling for a day now and it seems very complicated.
I have the development environment already set up with;
1. DNN Starter kit 2. VS 2008 3. SQL server 4. DNN up and running in IIS 5. the project builds successfully
If anyone knows a way I can build a module using the DNN Dynamic Module Template in VS 2008 and then strip off the DAL and all the unnecessary layers and extra controls until I have only a working view.ascx that just prints out "Hello World!" to the screen ...
I'm looking to create a simple watermark on the fly for an image, taking one image (JPEG) and adding some text to it on the BOTTOM of the image in white, with a solid black background right across the bottom. haven't been able to find anything that does it on the bottom of the JPEG.
i need to create a simple package that will: 1. insert a data to table A2. get the identity_scope3. insert multiple rows to table B with the id from table Ai created one, but it only does bulk insert, so i want to redo it again.
I am trying to convert a solution using EntLib into using AppFabric caching. By help of a few extension methods this is a fairly pain-free process.
Extension methods I use: public static bool Contains(this DataCache dataCache, string key) { return dataCache.Get(key) != null; } public static object GetData(this DataCache dataCache, string key) { return dataCache.Get(key); }
But there are two features of EntLib I find difficult to convert. Namely "Count" (counting number of keys in cache) and "Flush" (removing all data from cache). Both could be solved if I could iterate the keys in cache. There is a method called ClearRegion(string region), but that required me to specify a region name on all Get/Put/Add-methods I use, which would require some manual error-prone work.
Is there any way to get a list of keys in cache? Is there a default region name I can use? How can I flush the cache when I haven't used a region name?
Very new to ASP.NET and C# (somewhat knowledgable in PHP) I have an ASP.NET web application and need to manage access to pages based on a 'status' stored in a cookie. I would like to use the following code to create the cookie in a login method.
HttpCookie cookie = new HttpCookie("UserCookie"); cookie.Value = "status"; <-- this will be replaced with a variable once its working cookie.Expires = DateTime.Now.AddHours(1); Response.SetCookie(cookie);
My problem is that the only place I can put this code where it works is in the global.asax Session_Start method. It simply doesn't work anywhere else. I am checking the cookie creation in firefox options and see the ASP.NET_SessionId created but nothing else (This is all running on localhost).
Is the session status somehow interfering with the cookie creation? Do I need to configure something in Web.config? It would appear that the only time I can create a cookie is on Session_Start. Does anyone have any tips, perhaps I am missing something simple?
Rather than try to reinvent the wheel, how to create a stacked/segmented bar or point me to an existing control. Here's what I need:
Horizontal bar
Standard html
Each segment needs to be color coded from css
Each segment needs to be a percentage of the total (i.e. if total value = 100, then a value of 10 for one of the segments would be smaller than a value of 50)
Should be able to fit seamlessly into an html table cell Should not be an image Should only create a single bar with segments (not multiple bars/segmented bars) Server-side generated, no AJAX
This should be as simple as possible given x number of values, create x segments.
I'm looking for code examples or already-built controls.
I am looking for a simple (or best practice) way of pre filling some of the fields in a create form. As an example, say the create view is loaded for a model that has a datetime field. I want the textbox for that field to be filled with DateTime.Now. I don't need a javascript watermark or anything like that, I jsut want to pre fill the text box.
The GET version of my Create method in the controller just returns the view with no model so I am not sure where to set this value.I've beel trying to figure this out for a while and I must be missing something, I expected this to be really easy.
I have a subdomain mobile.JassimRahma.com and that's referring of course to a folder on my root called mobile.I just created a simple, very simple Default.aspx file and placed in the mobile folder but I am getting thie error:
I am trying to create a simple menu system using repeaters. In the system I want to use a different formatting for class sub items and am trying to use an If that checks the DataBinders results and branches if its "Classes" but when I compile the code is says:
Name "Container" not declared.
On all the tutorials online and MSDN the Container.DataItem is just assumed to work so i can't find any information on it not working. Can anyone who uses databinders more than me explain this?
I want to create a webmail like yahoo or gmail ? in which people can send email to yahoo and gmail and receive emails also ? at the same time i want that i can customize the css . I have heard of telerik webmail but the demo and the source code downloaded does not allows us send email .. .
Im about to create a very simple online event reservation application and currently have 3 tables:
User PK_UserID UserName Event PK_EventID EventName EventDescription EventStartDate EventEndDate SeatsAvailable BookedEvents ID FK_UserID FK_EventID
Do you have any experience of how to handle SeatsAvailable? I mean if SeatsAvailable is set to 5 and there are 5 users online and want to book event. And some user has started to fill out the form then changed his mind. Then seats in database can just leak. I was thinking about sessions - like to limit every user to 5 minutes to complete the booking but i dont really know.
I'm trying to create a very simple bar chart using the results of a JSon action method in MVC. I get the actual bar chart, but I don't understand the options and all that well enough, so I'm basically guessing what to do. I used the example on the HighCharts site as an example for how to get data from server code and create a chart. The difference is my chart is simpler than the example. I don't have categories for each user (as in the fruit example), I only have a user and a number of hours logged.
Here's the HighCharts jQuery code:
function getHighChart() { var actionUrl = '<%= Url.Action("GetChartData") %>'; var customerId = $('#customersId').val();[code]....
I was able to create a pie chart, but now when I want to create a simple bar I'm not able to work out what is what in the jQuery code, so the results I get is a bar where first of all the only user listed in the legend is the last one in the array. Secondly, the tooltip shows x = [The user's name], y = 29, instead of [The user's name]: 29, which I got in the pie chart.How would I create such a simple bar chart in HighCharts from this JSon?