asp.net

Best practice for dynamically added Web.UI.ITemplate classes

We have a couple of ASP.Net dataview column templates that are dynamically added to the dataview depending on columns selected by users. These templated cells need to handle custom databindings: public class CustomColumnTemplate: ITemplate { public void InstantiateIn( Control container ) { //create a new label ...

Should I migrate to ASP.NET MVC?

Hello, I just listened to the StackOverflow team's 17th podcast, and they talked so highly of ASP.NET MVC that I decided to check it out. But first, I want to be sure it's worth it. I already created a base web application (for other developers to build on) for a project that's starting in a few days and wanted to know, based on your ex...

enter key to insert newline in asp.net multiline textbox control

I have some C# / asp.net code I inherited which has a textbox which I want to make multiline. I did so by adding textmode="multiline" but when I try to insert a newline, the enter key instead submits the form :P I googled around and it seems like the default behavior should be for enter (or control-enter) to insert a newline. Like I sai...

NullReferenceException on User Control handle

I have an Asp.NET application (VS2008, Framework 2.0). When I try to set a property on one of the user controls like myUserControl.SomeProperty = someValue; I get a NullReferenceException. When I debug, I found out that myUserControl is null. How is it possible that a user control handle is null? How do I fix this or how do I find wha...

Asp.Net Routing: How do I ignore multiple wildcard routes?

I'd like to ignore multiple wildcard routes. With asp.net mvc preview 4, they ship with: RouteTable.Routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); I'd also like to add something like: RouteTable.Routes.IgnoreRoute("Content/{*pathInfo}"); but that seems to break some of the helpers that generate urls in my program. Thoughts? ...

Using MVP - How to use Events Properly for Testing

I've just started using the MVP pattern in the large ASP.NET application that I'm building (re-building actually) and I am having a hard time figuring out how I should be using Events applied to the view. Say I have 2 drop down lists in a User Control, where one is dependent on the other's value: <%@ Control Language="vb" AutoEventWire...

How do I configure an ASP.NET MVC project to work with Boo

I want to build an ASP.NET MVC application with Boo instead of C#. If you know the steps to configure this type of project setup, I'd be interested to know what I need to do. The MVC project setup is no problem. What I'm trying to figure out how to configure the pages and project to switch to use the Boo language and compiler. Chris ...

Update Panel inside of a UserControl inside of a Repeater inside of another UpdatePanel

Yes, it sounds crazy....It might be. The final updatepanel does not appear to trigger anything, it just refreshes the update panels and does not call back to the usercontrol hosting it. Any ideas? EDIT: I got it posting back, however the controls inside the final usercontrol have lost their data...I'm thinking its because the main rep...

How do I retrieve data sent to the web server in ASP.NET?

What are the ways to retrieve data submitted to the web server from a form in the client HTML in ASP.NET? ...

What is the best way to share MasterPages across projects

Suppose you have two seperate ASP.NET Web Application projects that both need to use a common MasterPage. What's the best way to share the MasterPage across projects without having to duplicate code? Preferably without having to resort to source control or file system hacks. ...

A WYSIWYG Markdown control for Windows Forms?

[We have a Windows Forms database front-end application that, among other things, can be used as a CMS; clients create the structure, fill it, and then use a ASP.NET WebForms-based site to present the results to publicly on the Web. For added flexibility, they are sometimes forced to input actual HTML markup right into a text field, whic...

ASP.NET - How do you Unit Test WebControls?

Alright. So I figure it's about time I get into unit testing, since everyone's been banging on about it for long enough. I've installed NUnit and gone through a few "intro to unit testing" type tutorials. I'm currently putting together a small framework to help with the rebuild of one of our web apps, so I've created a VS2008 project ...

Migrating from ASP Classic to .NET and pain mitigation

We're in the process of redesigning the customer facing section of our site in .NET 3.5. It's been going well so far, we're using the same workflow and stored procedures for the most part, the biggest changes are the UI, the ORM (from dictionaries to LINQ), and obviously the language. Most of the pages to this point have been trivial, bu...

Response.Redirect using ~ Path

I have a method that where I want to redirect the user back to a login page located at the root of my web application. I'm using the following code: Response.Redirect("~/Login.aspx?ReturnPath=" + Request.Url.ToString()); This doesn't work though. My assumption was that ASP.NET would automatically resolve the URL into the correct pat...

Is there a browser equivalent to IE's ClearAuthenticationCache?

I have a few internal .net web application here that require users to "log out" of them. I know this may seem moot on an Intranet application, but nonetheless it is there. We are using Windows authentication for our Intranet apps, so we tie in to our Active Directory with Basic Authentication and the credentials get stored in the browse...

Where can I find a good ASP.NET MVC sample?

I have been using Castle MonoRail for the last two years, but in a new job I am going to be the one to bring in ASP.NET MVC with me. I understand the basics of views, actions and the like. I just need a good sample for someone with MVC experience. Any good links besides Scott's Northwind traders sample? ...

Stackoverflow Style Notifications in asp.net Ajax

When you get a badge or aren't logged in to stack overflow there's a groovy little notification bar at the top of the page that lets you know there's something going on. I know the SOflow team use JQuery, but I was wondering if anyone knew of an implementation of the same style of notification system in asp.net AJAX. On a side note, wh...

How to make the process of debugging ASP.NET Sharepoint applications less time consuming?

I'm comparing it Java where you can start your application server in debug mode, then attach your IDE to the server. And you can change your code "on the fly" without restarting the server. As long as your changes don't affect any method signatures or fields you can just hit recompile for a class and the application server (servlet conta...

ASP.NET AJAX: Firing an UpdatePanel after the page load is complete

I'm sure this is easy but I can't figure it out: I have an ASP.NET page with some UpdatePanels on it. I want the page to completely load with some 'Please wait' text in the UpdatePanels. Then once the page is completely loaded I want to call a code-behind function to update the UpdatePanel. Any ideas as to what combination of Javascr...

How do I extract the inner exception from a soap exception in ASP.NET?

I have a simple web service operation like this one: [WebMethod] public string HelloWorld() { throw new Exception("HelloWorldException"); return "Hello World"; } And then I have a client application that consumes the web service and then calls the operation. Obviously it will throw an exception :-) ...