asp.net

Classic ASP Error Catching - Can it be done directly using an ASP.Net page?

Is it possible to catch ASP errors in ASP.Net (setup custom error pages in IIS) and somehow gain access to the Err oject or something similar like you would using server.GetLastError() in VBScript? Thanks. ...

converting virtual path to actual web path in ASP.NET

I have a virtual path (example: "~/Images/Banner.jpg") and I want to make that an absolute web path (example: "/ApplicationRoot/Images/Banner.jpg"). There is a method that will do this, I believe in a class called something like HTTPUtility or similar name. Though ever time I need this method, it takes me hours searching for it. It ...

Is there any way to modify query strings without breaking an ASP.Net postback?

From reading here and around the net, I'm close to assuming the answer is "no", but... Let's say I have an ASP.Net page that sometimes has a query string parameter. If the page has the query string parameter, I want to strip it off before, during, or after postback. The page already has a lot of client-side script (pure JavaScript and j...

Have to click twice to expand DropDownList in ASP.NET

I have inherited an ASP.NET 2.0 project and one of the things I have noticed is that the user has to click a dropdownlist twice in order to expand it - why is this? Sequence of Events The first click with give the control focus and the second will expand it. The application uses Master/Content pages and is Ajax enabled. It looks lik...

Getting "The source file is different from when the module was built."

I'm trying to debug an ASP.Net web project that I received. I modified a class in the "Apps_LocalResources" folder. When I debug and the code tries to step into that class, I get "The source file is different from when the module was built.". I rebuilt the solution and didn't get any change. I even published it to a different location an...

Account based lookup in ASP.NET

I'm looking at using ASP.NET for a new SaaS service, but for the love of me I can't seem to figure out how to do account lookups based on subdomains like most SaaS applications (e.g. 37Signals) do. For example, if I offer yourname.mysite.com, then how would I use ASP.NET (MVC specifically) to extract the subdomain so I can load the righ...

IIS7, RewritePath and IIS log files

Hi, I am using Context.RewritePath() in ASP.NET 3.5 application running on IIS7. I am doing it in application BeginRequest event and everything works file. Requests for /sports are correctly rewritten to default.aspx?id=1, and so on. The problem is that in my IIS log I see GET requests for /Default.aspx?id=1 and not for /sports. Thi...

Increasing ASP.net WebForm Performance

When designing a ASP.net WebForm application what are some important steps to take (or hacks if you like to use the term) to ensure the best possible performance (in terms of speed, stability, and scalability)? ...

Deployment Project dlls cause 'type x exists in both' errors

I have a WebApplication project, a business logic project, and a WebDeployment project for the web app. When I build solution, the deployment "Release" bin contains 1 dll for each of the projects - so I get one for MyWeb.dll, MyWebBusiness.dll, and MyWebDeploy.dll. When I try to run the site, it sees the same type in both MyWeb.dll...

MVC + IIS7 = CSS Issue...

I have a web site running via IIS7 on Vista. The site is running on port 88, so http://localhost:88 should render the default /Home/Index view. This works correctly, as do all other views. However, one problem is resident. My script paths point to /Scripts/[FILE] and my CSS paths point to /Content/[FILE]. My assumption was that the /...

.NET Web Service Best Practice for multiple developers

Hello, We have a large ASP.NET project consisting of several hundred reports. We are in the process of moving all the SQL Queries (running against an Oracle Database) into three web services. The web services are categorized by command, selections and report queries. We have to deploy a sub-set of our project using a SQL*Server backe...

Is storing an array of objects in ASP.NET viewstate the best solution for this?

I'm wondering if storing the data in viewstate is a good idea for this given problem. He's a simplified example of what I am trying to achieve, firstly we have a Repeater control: <asp:Repeater id="Repeater1" runat="server"> <ItemTemplate> <asp:TextBox id="Name" runat="server" /> <asp:TextBox id="Age" runat="server" /> </ItemTemplate> <...

Validate Radio Button Group Client Side

asp:RadioButton GroupName="EndorsementType" runat="server" ID="rdoRemoveProperty" Text="Remove Property from TIV" /> I was thinking about implementing a custom validator, and using a client javascript function to reference the radio button ids, (I'm using web forms, not mvc), something like.. if(document.getElementById(<%= rdoAddPro...

ASP.Net number of servers estimation

Let's assume our average page weights P KBytes and we've got N visits per unit time (let's say, per hour). How could we estimate the number of servers needed to support this load with a reasonable response time? ...

ADO.NET Entity Data Model Allows Circular Foreign Key Refs

I am using the new ADO.NET Entity Data Model on a simple database. I have a table/entity with a primary key (PageID) and a ParentID foreign key that references back to itself on PageID for a parent/child "0..1 to many" relationship. On a ASP.Net page, I'm using a FormView with a asp:DynamicControl to express this as a control. That p...

Setting the ASP.NET version via MSBUILD

I am trying to create a new website on a remote server via msbuild (I like to call it "msdeploy"). I've downloaded and used the SDC tasks, the MSBuildExtension tasks and the MSBuildCommunity tasks but I simply can't get it right. I figure that WebDirectorySetting (from MSBuild.Community.Tasks.IIS) is my best bet but I can't find the ri...

Really stupid ATM...why can't I reference Master.FindControl?

oPanel = CType(Master.FindControl("panelSearch"), Panel) This code resides on my masterpage's back-end (theMaster.master.vb), but I get a "Cannot refer to an instance member from within a shared class or shared member initializer without an explicit instance of the class" the function it resides in IS shared, I just can't remember for ...

How do I set a default role for a new user using Windows Authentication with the SqlRoleProvider?

I have an application that is using Windows Authentication and a SqlRoleProvider for user authentication and role management respectively. It is working fine with my test users that I have added to the database as defaults. The application requires users to login (using Windows credentials) and then be able to use this internal applica...

Solution Structure and Restful ASP.NET MVC

In making a restful ASP.NET MVC app I'm wondering about the best way to structure the projects in my solution. By convention, the controllers reside in the same project as the views. However, if I have a few different presentation tiers accessing my restful controllers, would it be better to put my controllers in a layer (project) lower ...

3rd party active directory component with built-in functionality

I still havent' figured out active directory, so I was hoping you guys could recommend some 3rd party components that would have all the built in methods done for me :) I usually build my own users table with permissions/role tables, but want to add active directory as an option so you can tap into users already setup on windows servers...