asp.net

ASP.NET/ADO.NET: Handling many database connections inside a .NET Object?

Hi! We have a .NET object that does a lot of reading/writing with the database. Throughout the life cycle of this object (or the asp page that uses it), it may hit the database with a query/update anywhere from 1 to 10 times. Instead of opening and closing a database connection every time the object needs to hit the database, it simpl...

How to stop ASP.Net website throwing HttpUnhandledException exception while browsing forward/back through paged listing of items?

Hi, I have an ASP.Net hosted website which displays a list of results as a DataGrid or ASP.Net Repeater with paging of results. If one scrolls quickly through the pages by pressing the Previous/Next tabs sometimes an HttpUnhandledException is thrown and the debug page rendered instead of the next listing of results. The debug screen is...

Adding Role to User Created in Web.config

I have a few users setup in the web.config of an asp.net site to handle authentication. Without getting into details I'm not using the full membership/role provider and would rather not have to implement it at the moment do to time constraints. However I do need the ability to assign a role to a user so that securityTrimming works on the...

Is there an easy way to scale a 'views' or 'download' counter in a DB row?

Hey Everyone, I'm working on a little web project that needs to keeps to a NumViews counter for each object/row in a DB table. I'm concerning that all the updates to rows would start really degrade performance both the table grows in object count, and the site would grow in use. I'm using .NET 3.5 with MSSQL 2K5 if it matters. Any su...

Add dynamic charts using ASP.NET CHART CONTROL, c#

I wanted to add dynamic charts in the webpage. It goes like this... I get the start and end date from user and draw separate charts for each date bewteen the start and end date. I get the data from sql database and bind it with the chart like this: SqlConnection UsageLogConn = new SqlConnection(ConfigurationManager.Con...

What is really stored in Session in ASP.NET?

We are trying to decide how to handle object persistence accross postbacks, to avoid getting the data from the database in every request, and I'm leaning towards using Session (it's an intranet application, there won't be thousands of users), but this is due to the fact that I suspect that only the reference to the real object is stored ...

Is "Commit" necessary when updating Oracle from asp.net?

I have this code protected void btnUpdateAddress_Click(object sender, EventArgs e) { sdsAddressComparison.Update(); } that I'm using to update an oracle database. When I run the update sql code in SQL Navigator I have to type "Commit" or hit the commit button. Do I have to code in a "Commit" somewhere in ASP.NET...

How to Toggle confirm message box from aspx.cs page

I have a search program that will be looking at a database from a database. If the date range is more than 3 weeks I want to alert them that it might take a while with all the data in the database. I have a confirm message box in a javascript funtion. I want to check the date range in the aspx.cs page. how do I totrigger the message ...

How do I continue working on the server after returning a response with ASP.NET? (WebForms and MVC)

Hi.I have an application where I need the user to upload a photo. After the photo is uploaded to the server, which shouldn't take very long, the user should get back a response that's a regular HTML page saying "thanks...bla bla bla..." Now, after the the response is sent back to the client and he goes on his merry way, I want the server...

ASP.NET Explicitly Post To Server From Checkbox Control OnCheckChanged Event

I have an asp:checkbox control, and I want to change the visibility of a Label when it is checked or unchecked. To do this I'm attempting to use the OnCheckChanged event, which apparently only fires after a post to the server. This means that my Label's visibility isn't changing immediately. How do I post to the server (and preserve the ...

ASP.NET sites, hiring external design firms and standards

Hey. We're building a large ASP.NET website, and have hired an external firm to do the design (CSS + protoype pages). In fitting the design to the page, we've found a number of problems that indicate ASP.NET's workings were never considered. My question is - Is there a common standard (that should be) used by design firms creating what w...

A question about datasource objects in ASP.net

When using DataSources in ASP.net applications, paging and sorting along with GridView only works out of the box when using DataSet, DataTable, DataViews if you are using anything else you need to implement methods that perform paging as well as partial data retrieval from the datasource. I dont know many design nowadays that pass around...

Simple Hackable URL implementation for ASP.NET (3.5)

I'm looking for a good sample project, or web site reference, which gives a simple easy to understand overview of URL Rewriting and making Hackable URLs. I've read a good amount about the concept, but I'm specifically looking for a good implementation example for a programmer to use to get started. This is specifically for .NET 3.5, so...

How to Instantiate User control in Master page cs file

I have added uc in contentplace holder of master page but how do you instantiate the user control in master page .cs file to make it visible when the master page loads ...

Create a Search Engine with SQL 2000 and ASP.NET C#

I am looking to create a search engine that will be based on 5 columns in a SQL 2000 DB. I have looked into Lucene.NET and read the documentation on it, but wondering if anyone has any previous experience with this? Thanks ...

Using a Base Controller for obtaining Common ViewData

I am working on an ASP.NET MVC application that contains a header and menu on each page. The menu and header are dynamic. In other words, the menu items and header information are determined at runtime. My initial thought is to build a base Controller from which all other controllers derive. In the base controller, I will obtain the ...

ASP.NET URL rewriting for DB query from URL content without extension

I am trying to create a very simple ASP.NET application that presents information out of a datbase based on the URL, similar to a wiki, but in this case the site is read-only. An example of a url I'd like would be: http://www.foo.com/bar and then it would use "bar" as a SQL query parameter to show information from a database that matc...

Best practice to maintain site class(es)

I am building a web application which uses an externally built class to handle much of the work and rules for the site. Most pages will require access to this class to get the information it needs to display. In the past I would put such a class in a session variable, so it's easily accessible when required and not need to be continual...

Moving towards Ruby on Rails from ASP.NET

I am ASP.NET developer from last 5 years and still loving it. There are lots of good voices in air about Ruby on Rails. I want to ask to community, Is there any worth trying to learn Ruby On Rails as a ASP.NET web developer on following point of view. Scalability Documentation Community Support Hosting Solutions Deployment ETC. ...

C# ASP.NET 3.5 content-disposition file download problems

I have a sql database that stores some documents. A user can sign into the application, and view a list of their documents. When clicking a linkbutton download in a gridview of their docs, I get the file from the database, write it to the file system, and then execute this code. System.IO.FileInfo file = new System.IO.FileInfo(Sys...