asp.net

ASP.NET Development Server or Localhost IIS?

Currently our dev team set up all the websites they're working on in IIS on their local machine. We're thinking of switching to using the built in ASP.NET development server instead. Is this a good idea? What are the pros / cons of using the ASP.NET dev Server? Are there any gotchas we should be aware of? Thanks. NB: Running on Win XP...

How to create an ASP.NET custom control with a dash in the name?

I want to set up an ASP.NET custom control such that it has a custom name, specifically, with a hyphen within it, so it might look like this in markup: <rp:do-something runat="server" id="doSomething1" /> I don't mind if this syntax requires setting up a tag mapping in web.config or something to that effect, but the tagMapping element ...

How do I find the remote host name in asp.net?

Hi, I used code like this to find the remote user name: banner_label.Text = "Welcome, <B>" + User.Identity.Name + "</B>!" I'd also like to find the remote host name. My production environment will be a corporate intranet with active directory. ...

Best Strategies for preventing addresses with PO Boxes?

I have a client which is shipping via UPS, and therefore cannot deliver to Post Office boxes. I would like to be able to validate customer address fields in order to prevent them from entering addresses which include a PO box. It would be best if this were implemented as a regex so that I could use a client-side regex validation control ...

Code Pointers in VS.Net 2003 are out of whack.

I have a .net 1.1 project in VS.Net 2003 (using C#) in which I can set a breakpoint in one method, and step through code just fine, but when I hit one specific method (which we also wrote), the breakpoints and code pointers go "whacky", for lack of a better term. If the breakpoint is on line 100, the execution pointer stops on line 101....

Reg-Free COM in an ASP.Net application

I am wondering if it is possible to use Reg-Free COM in an ASP.Net application? ...

Access Response Object in a class ASP.NET

I have a function that checks if a cookie (by name) exists or not: Private Function cookieExists(ByVal cName As String) As Boolean For Each c As HttpCookie In Response.Cookies If c.Name = cName Then Return True Next Return False End Function I have a class that handles cookies in an application-specific manner, and I ...

What do you suspect when ASP.NET ignores a CustomValidator?

This is as much a code maintenance issue as a code issue, but I have a WebForm that no longer checks it CustomValidator. It worked when I last touched the code over a year ago, but it no longer works now that the user has requested some changes ... The WebForm contains a data-bound drop down with a default " - All -" item with String.Em...

What are all the valid ASP.NET Webmethod return types?

Can my webmethod only return strings like I see in all the asp.net site examples? ...

Can ASP.NET 3.5 Web Application Projects be Extended or Patched "in Flight"?

In building an ASP.NET 3.5 WAP, I'm always frustrated by the feeling that no matter how I "isolate" or "encapsulate" bits of logic or UI I'm still going to bring down the whole site any time I need to update a single line of code. I may be misunderstanding how ASP.NET handles changes in the "bin" directory, but given the number of "why i...

Learning C#, ASP.NET 3.5 - what order should I learn in / what to skip?

There's a lot to C# & ASP.net. Where should I start? What should I not bother focusing on? Should I learn Winforms then WPF? Ditto for webforms / Silverlight? Should I learn ASP.MVC or classic ASP.NET? If both, which first? In the either/or cases - which will make more sense having known the other first? What major .NET feature(s) sho...

Update with Data Source Control in asp.net

How do you run an update query in a data source control from a button? I have the data source control with the update query configured in it. I just don't know what to put in the button_click event to make it run. ...

Dealing with Method Calls/XSLT Tranform in ASP.NET

I've got an ASP.NET page that uses code similar to the following: <asp: repeater> <tr><td><b>LabelName</b></td><td><%# SomeMethod(parameter) %></td></tr> </asp: repeater> These Labels are presently hardcoded, but there is an XML document that contains something like the following: <label type="LabelA" name="LabelName" />> ...

How can I implement a Read-Through File Cache in ASP.NET?

I have a system which sits on a web server and generates files on the fly in response to HTTP requests. This is currently implemented as an HTTPHandler. Once the files are generated, they don't change very often, so I'd like to implement a cache. Ideally, I'd like the web server to look at the cache folder and serve the files directly ...

ASP.net Profiles and Membership - Custom Providers or should completely I roll my own?

Hello, first off, I know that this question could be borderline-duplicate to this one, and yes, it is a bit ironic that I am asking a question for something that I even answered myself. Now, I am talking about ASP.net Profiles. I am building an application using MVC if that matters, and I believe that the built-in Profile Provider is u...

ASP.NET - What is the correct approach to JSON based web services with jQuery?

What is the correct way to convert ASP.NET SOAP-based web services to JSON-based responses? ...And then call these from jQuery? What are "best practices" when integrating jQuery based AJAX and ASP.NET? Articles? Books? ...

ASP.NET Development Server simulates IIS6 or IIS7?

In visual studio 2008, when we press Ctrl+F5, the ASP.NET Development Server is launched to simulate a Web Server. I'm wondering what server does it simulate? IIS6 or IIS7? Is it possible to customize what server it simulate? ...

Connected vs Disconnected Architecture in asp.net

what are advantages & disadvantages of connected & disconnected Architecture (database) over one another in asp.net ? ...

Upload a file and get a headache - htmlfile: Access Denied

We have a page that lets users upload a file using the asp:FileUpload control. When the user tries to submit the form the get a client side javascript error "htmlFile: access denied". This only happens in IE 7 (not sure about 6) and FF is OK. Apparently this is due to a security setting that was introduced to IE with XP SP2. Fair eno...

Why does __VIEWSTATE hidden field gets rendered even when I have the EnableViewState set to false

I saw that __VIEWSTATE field gets rendered even though I have set the EnableViewState="false" at the page level. This field is not rendered if I remove runat="server" tag for the form element. Can somebody please explain this? ...