asp.net

ASP.NET Site Maps

Has anyone got experience creating SQL-based ASP.NET site-map providers? I've got the default XML web.sitemap file working properly with my Menu and SiteMapPath controls. But I'll need a way for the users of my site to create and modify pages dynamically. I'll need to tie page viewing permissions into the standard ASP.NET membership s...

How do I sync the SVN revision number with my ASP.NET web site?

stackoverflow.com has a version number at the bottom: "svn revision: 679" I want to use such automatic versioning with my .NET web, win forms, wpf projects/solutions....

Floating Point Number parsing: Is there a Catch All algorithm?

One of the fun parts of multi-cultural programming are numbers formats. Americans use 10,000.50, Germans use 10.000,50, French use 10 000,50 etc. My first approach would be: Take the string, parse it backwards, until I encounter a separator and use this as my decimal separator. The obvious flaw with that: 10.000 would be interpreted as ...

ASP.NET, Visual Studio and Subversion - how to integrate?

I use AnkhSVN and Visual Studio 2005 and 2008. Now, one thing that bugs me is that Ankh does not really work with ASP.NET sites. I cannot add them properly to a repository and it won't detect changes, especially because the site is on a remote server accessed through Frontpage Extensions (File => Open Site). What are the alternatives? D...

How to write to Web.Config in Medium Trust ?

Uploading my first decently sized web app to my shared host provided me with a fresh set of challenges, by which I mean, sleepless nights. The issue was that I had most certainly not developed my application for medium trust (or had any clue what that was.) I mitigated all of the issues, save one. I had written an installer for the a...

Checklist for IIS 6/ASP.NET Windows Authentication?

I've been having trouble getting my ASP.NET application to automatically log users into the Intranet site I'm building. No matter the googling or the experimentation I applied, there is always a login box displayed by IE7. I've got Windows authentication mode set in the Web.config, disabled anonymous access and configured the correct d...

Decent, simple, GIS/mapping component for ASP.NET?

I need to display a map of the U.S. with states shown in different colors according to underlying data. I'd also like to have this map contain some facility for subscribing to hover/click events on each state in javascript, presumably using an imagemap. The data won't be changing in any kind of AJAX-y way, so ideally this component would...

How to get the value of built, encoded ViewState?

I need to grab the base64-encoded representation of the ViewState. Obviously this would not be available until fairly late in the request lifecycle, which is OK. For example, if the output of the page includes: <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJODU0Njc5MD...==" /> I need a way on the server side t...

ASP .Net Custom Client-Side Validation

I have a custom validation function in JavaScript in a user control on a .Net 2.0 web site which checks to see that the fee paid is not in excess of the fee amount due. I've placed the validator code in the ascx file, and I have also tried using Page.ClientScript.RegisterClientScriptBlock() and in both cases the validation fires, but c...

Bandwith throttling in IIS 6 by IP Address

I am writing an application that downloads large files in the background. All clients are logged in locally, or through a VPN. When they are logged in locally, I do not want to throttle downloads. However, I would like to limit downloads to 10 KBps when the user is connected via VPN. I can differentiate between these users by IP Address ...

What's a good book for learning ASP?

I'm an experienced programmer in C/C++, Java and PHP and I've recently become interested in learning ASP.NET. I'm looking for a book geared toward someone who already knows web development (I don't need to relearn HTML and CSS) and programming that will dive into using ASP. Also, a book that teaches ASP development using Visual Studio ...

ASP.NET built in user profile, Vs old stile user class/tables

I am looking for the spiritual guidance of what is the best practice around the use of Profile feature in ASP.NET. How do you decide what should be kept in the built in user Profile, or if you should just go and create your own DB Table and add a column for that? For example, a user has a zip code, should I save the zip code in my own t...

Triple Quotes? How do I delimit a databound Javascript string parameter in ASP.NET?

How do I delimit a Javascript databound string parameter in an anchor OnClick event? I have an anchor tag in an ASP.NET Repeater control. The OnClick event of the anchor contains a call to a Javascript function. The Javascript funciton takes a string for it's input parameter. The string parameter is populated with a databound val...

How to RedirectToAction in ASP.NET MVC without losing request data

Using ASP.NET MVC there are situations (such as form submission) that may require a RedirectToAction. One such situation is when you encounter validation errors after a form submission and need to redirect back to the form, but would like the URL to reflect the URL of the form, not the action page it submits to. As I require the form...

Are Multiple DataContext classes ever appropriate?

In order to fully use LinqToSql in an ASP.net 3.5 application, it is necessary to create DataContext classes (which is usually done using the designer in VS 2008). From the UI perspective, the DataContext is a design of the sections of your database that you would like to expose to through LinqToSql and is integral in setting up the ORM ...

ASP.NET MVC "CRUD" Database Sample

I'm trying to get my head around ASP.NET MVC coming from a LAMP development environment. This isn't for anything production or mission-critical, just a guy trying to learn. I've looked at all I can on http://asp.net/mvc but a lot of those videos and tutorials seem to assume you know ASP.NET WebForms (which I don't) although I am quite ha...

How do I define custom web.config sections with potential child elements and attributes for the properties?

The web applications I develop often require co-dependant configuration settings and there are also settings that have to change as we move between each of our environments. All our settings are currently simple key value pairs but it would be useful to create custom config sections so that it is obvious when two values need to change...

Easy way to AJAX WebControls

I've got an web application that I'm trying to optimise. Some of the controls are hidden in dialog-style DIVs, so I'd like to have them load in via AJAX only when the user wants to see them. This is fine for controls that are mostly Literal-based (various menus and widgets), but when I have what I call "dirty" controls - ones that writ...

How can I change the background of a masterpage from the code behind of a content page?

I specifically want to add the style of background-color to the body tag of a master page from the code behind (C#) of a content page that uses that master page. I have different content pages that need to make the master page have different colors depending on which content page is loaded in such that the master page matches the cont...

ASP.NET URL Rewriting

How do I rewrite URL's in ASP.NET? I would like users to be able to goto http://www.website.com/users/smith instead of http://www.website.com/?user=smith ...