asp.net

How do I apply conditional logic to determine which master page to display in asp.net?

I have 2 master pages and a single content page. How do I show employees one master page and customers a different one? This is for an asp.net mvc app. ...

Storing Language in URL or Session or other

I am developing a multilingual site and was wondering what is the best way to store the language chosen by the user? Either via QueryString or should it be in Session..or any other options? ...

License a .Net Web Site

Hello, I was wondering what is the preferred method of licensing a web site? I distribute precomplied versions of my web sites with editable APSX files, the code behind is complied into separate DLL's for each page. I have thought of implementing some sort of text injection into each page, similar to what Telerik controls do, when usi...

which design pattern to use for filtering query? c#

I have a database table with a list of products (clothing). The products belong to categories and are from different stores. Sample categories: tops, bottoms, shoes Sample stores: gap.com, macys.com, target.com My customers can request to filter products in the following ways: all products (no filter) by category by store by categor...

How do I change the URLs that Dynamic Data generates me for entity relationships?

I am using ASP.NET Dynamic Data to create a website that has two aspects - a public view, where data can only be viewed, and a admin site where all the CRUD operations happen. I want this to be a single DD website. I have setup two routes: routes.Add(new DynamicDataRoute("admin/{table}/{action}.aspx") { Constraints = ne...

Unable to start debugging on the web server. The underlying connection was closed: The connection was closed unexpectedly.

So, I was setting a whole bunch of "unnecessary" windows services to disabled, and then I encountered the: "Unable to start debugging on the web server. The underlying connection was closed: The connection was closed unexpectedly." error. I think this specific error is a bit different than the typical "Unable to start debugging on the w...

How to program this game with basic C# and ASP .NET knowledge?

Hi, I would love to brainstorm with you guys on how to program this game (originally a flash game) in C#. I'm studying C# right now and my knowledge is pretty limited: I know the pretty much the basics of C# but I need your help with the concept. Here's the game: http://www.composica.com/product/samples/AstroHops/content/scaler.html I...

ASP.NET custom config entries / ConfigurationSections + business logic validation?

Hi folks, i've got some custom config entries in my .config files. All loads/works fine. I was wondering if there's a proper way to check the data that has been provided -- adding some business logic. For example... <logFileSettings> <logFile fileName="foo.log" uniqueName="log1"> <alerts> -= snip =- </a...

Understanding ASP.Net & Databases

I could do with a bit of guidance understanding the world of asp.net & databases. There seems to be so many options I'm not really sure what to look into & what to use in different situations. I've created websites that have used datasets in the past, but I never really understood what was going on or why I should or shouldn't be using...

Get Html from a Url in ASP.NET MVC

I need to save a page from url - This page is in my own application - in html format. This html will then be send by email to a user. Any anyone knows how? ...

Deleting Database in Linq

In normal condition, I can add schemas in the dbml file to empty database with code below. But now when I run this code, I take the error "Cannot drop database "test" because it is currently in use." How can I do it? Dim db As New UI_Class.UIData If db.DatabaseExists Then db.DeleteDatabase() End If db....

Is there any memory restrictions on an ASP.Net application?

I have an ASP.Net MVC application that allows users to upload images. When I try to upload a really large file (400MB) I get an error. I assumed that my image processing code (home brew) was very inefficient, so I decided I would try using a third party library to handle the image processing parts. Because I'm using TDD, I wanted to fi...

How to merge the result from database call?

I have a web report needs to return multiple products from different regions. The simplified query will be like: Select ProductName, ProductPrice from Product where Region in (Region1, Region2, Region 3) The regions are selected by users from UI. The result is bound to a datagrid. It could be multiple regions. But the result will be...

Redirect user to Mulitple Login Pages using ASP.NET Membership

Redirect user to Login Page dependent on the Folder they are in. I have a web application with the root directory which is used by all users and the admin site. For people that would require the authenticated functionality of the site, they would require to login and be redirected to root/login.aspx. However, when an Admin needs to logi...

ASP.NET Membership - User Times out Earlier than Expected

Is there any other reasoning other than the timeout setting in the web.config not being used? It might be the default timeout of 30 minutes but it is definitely less than 30 minutes. <authentication mode="Forms"> <forms timeout="50000000" loginUrl="content/login.aspx"/> </authentication> And for the code behind on my Login.asp...

Html.Checkbox does not preserve its state in ASP.net MVC

I have this annoying issue with the checkbox created using the Html.Checkbox extension method. Apparently the state of the checkbox is not saved in case of a postback (due to a form validation error). Delving into the MVC code itself (System.Web.Mvc.Html.InputExtensions) I found out that the 'checked' property is determined by calling 'h...

Upgrade from .NET 3.0 to 3.5: Sites set to StateServer revert to InProc when in Web Garden

Scenario: Take a server running .NET 3.0 and an ASP.NET Web site running in an application pool that has Web gardens enabled (number of processes: 3). The web.config configuration is as follows: <sessionState cookieless="UseCookies" cookieName=".authz" mode="StateServer" regenerateExpiredSessionId="true" ...

Resource.axd files - Why so many and why so big?

ASP.NET - I've managed to siginificantly reduce the number of .axd requests a page of mine is making by using the ajax ToolkitScriptManager control. My question now is, why on earth is there SO MUCH JavaScript in those .axd files? I'm talking approx. ~1MB (un-gzipped) just to use a few Ajax controls on a page! Is there anyway to make t...

Cannot authorize with different server name

Hi all I have a web service running in IIS 6.0 on Windows 2003. It's authentication mode is Integrated Windows security (anonymous disabled), and authorization is done with Authorization Manager and an XML authorization store. My test user is a domain user (admin, actually) with membership in an authorized role. I am testing this (for ...

ASP.NET web application architecture design advice

Hello everyone, previously my ASP.NET web application connects to a database directly using ADO.NET. Now I want to change it to 3 layers, ASP.NET layer, middle web service layer and backend database layer. I think there is benefit that I could abstract data source to ASP.NET front layer, loosely coupled and reduce potential security ris...