asp.net

Caching strategy, Output Cache vs Data Cache or both?

I'm working on an ASP.NET MVC project and I've come to the point where I want to start considering my caching strategy. I've tried to leave my framework as open as possible for the use in caching. From what I heard during Scott Hanselman's podcast StackOverflow.com uses page output caching and zips that content and puts it into RAM. T...

ASP.net Inline Expression Issue.

I can't seem to figure out why this does not work below. I need to bind the text box to a value from an inline expression. Seems like a simple thing right? But neither of these work. Any ideas? Thanks in advance. <asp:textbox id="tbName" runat="server" Text='<%# Eval("test") %>' /> <asp:textbox id="tbName" runat="server" Text='<%= "test...

NHibernate - SELECT DISTINCT equivalent for a page filter - Northwind

Lets say you are working in SQL 2005 with a copy of Northwind database installed. Your working on an ASP.NET application with an Employees "browse" page. At the top of the page you have a "Title" filter where you would like to display these 5 choices in a dropdown: [ALL] Vice President, Sales Sales Representative Sales Manager ...

sql session time out recommondation

One of my applications uses sql session state, the timeout is currently set to 20 minutes. My question is, since this is stored in the database and not in server memory, I should be able to increase the timeout without any significant performance issues right? I dont really understand the importance of the timeout for the database sess...

Custom Membership Provider, implementing developer security

I created a custom Membership provider (Membership ToolKit) and added methods like: public MembershipUserCollection GetAllUsers(string applicationName, int pageIndex, int pageSize, out int totalRecords) { // Returns MembershipUserCollection } Methods like these help in managing the entire Membership data storage for all applicati...

Use a Computed Property as DisplayColumn in ASP.Net Dynamic Data?

I am trying to display a 'Software Release' table in an asp.net dynamic data site. The Release table has a build number stored as three int fields (Major, Minor, Build). I'm using EntityFramework, so I have an EF model bound to my database schema. In my dynamic data site, I want the build number to show up as a single field (Major.Mino...

Design-time trouble with ASP.NET v2.0 Custom Control, with List<T> for child items

Folks, I am having a devil of a time with a custom control. The control is very simple - it just displays a list of "StepItems" (rendered as table rows), each with an icon. When I first drag it onto a page, and add StepItems to its collection, it renders perfectly. If I provide some text for its Header property, that also renders per...

Default radio button not triggering an UpdateControl postback

I have three radio buttons on a form - A, B, C. Each of these selections populates a dropdown list with data specific to the option. When the form loads, I set option A to be checked (as the default). When I select buttons B or C, the AsyncPostBack triggers fine and the dropdown is populated. BUT, subsequently selecting A from either B...

ExecuteScalar gives NullReferenceException

Please look at this code when it goes for ExecuteScalar it gives an error : NullReferenceException I tested it inside sql server and it worked selectedPassengerID = 0; //SqlCommand command = GenericDataAccess.CreateCommand(); // 2nd test string connectionString = ""; SqlConnection conn; ...

Modifying <asp:label> in form

I am developing a form using all asp:textbox and asp:label. Currently, I am using the RequiredFieldValidator to validate text boxes and display an error inline. What I am trying to do is to change the color of one of the asp:labels after validation fails for one of the textboxes fields. Would I accomplish this with javascript, or is ...

ASP.NET Repeater Template, Conditional Code for every Nth element

I'm using an asp.net repeater to create a bunch of images. The image markup is all the same so the standard <ItemTemplate> is fine. However, I want to wrap K images in a div. Lets say I bind 25+ images to the repeater and I want 5 images per div. How do I go about conditionally creating the start and close tags for the div? Is this a...

Javascript to access control in MasterPage

I have a textbox control Super1 in my MasterPage. I am using javascript to access this control from my content page like this: <asp:Content ID="ContentPage" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <script type="text/javascript"> function Somethin() { { document.forms[0].elements['Super1'].valu...

Asp.net Dev Server using wrong version of the framework?

Currently developing an ASP.NET WebApplication with VS2008. I stopped development for a few weeks, and when I came back, my project is exhibiting the following problem: The whole project compiles fine (all targeted to Framework3.5SP1). However, when I launch it (with ASP.NET Development Server), I get a message (from the browser) that t...

Read excel file from a stream

Hi! I need a way to read a Excel file from a stream. It doesn't seem to work with the ADO.NET way of doing things. The scenario is that a user uploads a file through a FileUpload and i need to read some values from the file and import to a database. For several reasons i CAN'T save the file to disk, and there is no reason to do so eig...

ASP generated javascript

Hi, I'm wondering if someone can point me in the right direction. I've got an ASP.NET web application. And there's autogenerated portion of JavaScript in every page that handles postback. Sometimes that javascript is surrounded by <[CDATA[ ... ]]> , while on the other machine it may be enclosed in simple HTML comment like <!-- .....

What is the best way to debug an asp page?

I'm trying to get an ASP page to work, but it keeps blowing up. How do I get it to display "response.write" info instead of blowing up? p.s. I noticed this as a technique and plan to give it a try. On top of page ad On Error Resume Next After each line of code use If Err.Number <> 0 Then Response.Write Err.Description Err.Clear End if...

Disabling a module in a program by not shipping the .dll

Hi, If you distribute a .net web application, and you want a certain module of the application to be disabled, AND you don't want to ship the source with it, is it a reasonable solution to just not include the necessary .dll for that module? I know you can do things programatically, but as long as you don't ship the .dll things should ...

ASP.NET Charting and User Control Output Caching

I'm using the new asp.net chart control within a user control. I tried to use the output cache directive to cache the user control for 30 seconds. The caching is custom depending on the logged in user. The chart data is being lost while the control is cached. I see the chart one every 30 seconds but at no point inbetween. Am I missing s...

How do I join a select distinct to a select sum?

I am trying to join a select disinct statement to a select sum statement. Here is an example of the data CD STDATE ENDDATE PR F1 01/02/09 01/04/09 $10 F1 01/02/09 01/04/09 $40 F1 01/02/09 01/04/09 $20 F1 01/02/09 01/04/09 $30 F1 01/22/09 01/26/09 $10 F1 01/22/09 01/26/09 $50 F1 01/22/09 01/26/09 $20 My desi...

Store pictures as files or in the database for a web app?

My question is fairly generic and I know there might not be an 100% answer to it. I'm building an ASP .NET web solution that will include a lot of pictures and hopefully a fair amount of traffic. I do really want to achieve performance. Should I save the pictures in the Database or on the File system? And regardless the answer I'm more ...