asp.net

ASP.NET MVC vs. Web client software factory (WCSF)

I have recently been doing a bit of investigation into the different types of Model View architectures, and need to decide which one to pursue for future in-house development. As I'm currently working in a Microsoft shop that has ASP.NET skills, it seems my options are between ASP.NET MVC and WCSF (Monorail is probably out of the as it w...

How would you go about using the ASP.NET AJAX Control Toolkit in a project that doesn't use ASP.NET on the back end

Your backend could be PHP or Python but you want to use the controls from the ASP.NET toolkit is there a successful way to do this? ...

Could not load type 'XXX.Global'

Migrating a project from ASP.net 1.1 to ASP.net 2.0 and I keep hitting this error. I don't actually need Global because I am not adding anything to it, but after I remove it I get more errors. ...

How do you get the logged in Windows domain account from an ASP.NET application?

We have an ASP.NET application that manages it's own User, Roles and Permission database and we have recently added a field to the User table to hold the Windows domain account. I would like to make it so that the user doesn't have to physically log in to our application, but rather would be automatically logged in based on the curre...

Secure session cookies in ASP.NET over HTTPS

I got a little curious after reading this /. article over hijacking HTTPS cookies. I tracked it down a bit, and a good resource I stumbled across lists a few ways to secure cookies here. Must I use adsutil, or will setting requireSSL in the httpCookies section of web.config cover session cookies in addition to all others (covered here)? ...

Asp.net path compaction

I have an asp.net url path which is being generated in a web form, and is coming out something like "/foo/bar/../bar/path.aspx", and is coming out in the generated html like this too. It should be shortened to "/foo/bar/path.aspx". Path.Combine didn't fix it. Is there a function to clean this path up? ...

How can you find out where the style for a ASP .Net web page element came from?

I have a quandary. My web application (C#, .Net 3.0, etc) has Themes, CSS sheets and, of course, inline style definitions. Now that's alot of chefs adding stuff to the soup. All of this results, not surprisingly, in my pages having bizarre styling on occasion. I am sure that all these styles are applied in a hierarchical method (alth...

Using ActiveDirectoryMembershipProvider with two domain controllers

We have an ASP.NET application running at a customer site that uses ActiveDirectory for user login via the ActiveDirectoryMembershipProvider. Their primary domain controller that we were pointing to went down this morning, and in getting everything set back up the client was wondering if we could have a redundant connection to two domain...

Is there a ClientScriptManager.RegisterClientScriptInclude equivalent for CSS

The ClientScriptManager.RegisterClientScriptInclude method allows you to register a JavaScript reference with the Page object (checking for duplicates). Is there an equivalent of this method for CSS references? Similar questions apply for ClientScriptManager.RegisterClientScriptBlock and ClientScriptManager.RegisterClientScriptResource...

AJAX Dropdown extender question

I am using the example on the AJAX website for the dropdown extender. I'm looking to make the target control, the label, have the dropdown image appear always instead of just when I hover over it. Is there any way to do this? ...

Programmatically accessing Data in an ASP.net 2.0 Repeater

This is an ASP.Net 2.0 web app. The Item template looks like this, for reference: <ItemTemplate> <tr> <td class="class1" align=center><a href='url'><img src="img.gif"></a></td> <td class="class1"><%# DataBinder.Eval(Container.DataItem,"field1") %></td> <td class="class1"><%# DataBinder.Eval(Container.DataItem,"field2") %></td> ...

Prevent Multi-Line ASP:Textbox from trimming line feeds

I have the following webform: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TestWebApp.Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="serve...

As a ASP.NET programmer, do I need to be concerned about email injection attacks ?

There are lots of PHP articles about the subject so is this a PHP only problem. I am sending emails using System.Net.Mail after some regular expression checks of course. Similar to http://weblogs.asp.net/scottgu/archive/2005/12/10/432854.aspx ...

Hidden Features of ASP.NET

There are always features that would be useful in fringe scenarios, but for that very reason most people don't know them. I am asking for features that are not typically taught by the text books. What are the ones that you know? ...

How do I convert a .docx to html using asp.net?

Word 2007 saves its documents in .docx format which is really a zip file with a bunch of stuff in it including an xml file with the document. I want to be able to take a .docx file and drop it into a folder in my asp.net web app and have the code open the .docx file and render the (xml part of the) document as a web page. I've been sea...

NullReferenceException on instanciated object ??

This is a segment of code from an app I've inherited, a user got a Yellow screen of death "Object reference not set to an instance of an object" on the *bool l_Success* ... line. Now I'm 95% sure the faulty argument is *ref l_Monitor* which is very weird considering the object is instanciated a few lines before. Anyone have a clue why it...

How do I insert text into a textbox after popping up another window to request information?

I have an asp.net web page written in C#. Using some javascript I popup another .aspx page which has a few controls that are filled in and from which I create a small snippet of text. When the user clicks OK on that dialog box I want to insert that piece of text into a textbox on the page that initial "popped up" the dialog/popup page. I...

Refresh all update panels on the page?

I have some code that modifies a value that several controls in other update panels are bound to. When this event handler fires, I'd like it to force the other update panels to refresh as well, so they can rebind. Is this possible? Edit: To clarify, I have an update panel in one user control, the other update panels are in other user...

asp consuming a web service, what do do with recordset object ?

Currently I run an classic (old) ASP webpage with recordset object used directly in bad old spagethi code fasion. I'm thinking of implementing a data layer in asp.net as web serivce to improve manageability. This is also a first step towards upgrading the website to asp.net. The site itself remains ASP for the moment... Can anybody rec...

ASP.NET Web Application Build Output - How do I include all deployment files?

When I build my ASP.NET web application I get a .dll file with the code for the website in it (which is great) but the website also needs all the .aspx files and friends, and these need to be placed in the correct directory structure. How can I get this all in one directory as the result of each build? Trying to pick the right files out ...