asp.net

What are some best practices for managing background threads in IIS?

I have written an HttpModule that spawns a background thread. I'm using the thread like a Scheduled Task that runs in-process, which is really handy. What are best practices for keeping track of this thread? I've never done this before, and I'm a little confused about some aspects of it: How do I know if the thread is still running...

Is it possible to have a personalized ASP.NET web app with only some SSL pages?

I have a web application that once signed in, personalizes almost all pages. I want to be able to have some very specific pages locked down with SSL that may have sensitive information. From what I have been able to find, once you sign in via an SSL sign in page (area of the web site), the session information which I use to store a lot...

ASP.NET freelance web developer open source tools and software

I will shortly be looking to take on some small freelance web based projects. I would really like your opinions on the best of breed tools/software available for freelance web projects. These tools will preferably be free or cheap (or great value). The tools I am talking about are things like: CMS Ecommerece Project management soft...

Unit Testing Code that calls VirtualPathUtility.ToAbsolute

I'm trying to unit test some code that calls into VirtualPathUtility.ToAbsolute Is this possible with the unit testing tools provided with VS 2008. ...

Where should I store configuration data for custom-controls (user-controls) ?

I'm writing a custom control and I would like to include some configuration options for the control, but I'm not sure where I should put them. I could probably put them in the the web.config of the application where I'm using the control, but that seems a bit messy to me. What should I be doing? EDIT: The configuration data will typi...

Ashx handler cannot be used through an <asp:Image> control

Hello all, In an ASP.NET 3.5 application, I have created an ashx handler as below: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.IO; using System.Web.Services; namespace TestWebConfig { [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfil...

Question about Html.Routelink output - ASP.NET C# MVC

Hi, I have a call that looks like this: <%= Html.RouteLink(item.displayName, "DisplayCategory", new { category = Html.Encode(item.displayName), subcat = item.searchName }) %> and I'm getting html that looks like this: http://localhost:1485/Home/ShowCategory/Electronics%20&amp;%20Photography?subcat=electronics-photo Why does the UR...

jQuery / ASP MVC -- parsererror in "$.ajax" calls

I'd like to create a simple action link in ASP.Net MVC RC2 using jQuery 1.3.1 - something like this: <a href="#" onclick="AjaxTest1()">Tester</a> with the AjaxTest1 function: function AjaxTest1() { $.ajax({ url: "Home/Ajax1", error: function(request, status, error) { ...

Update panel and javascript

Hello All, I have a user control whose structure is - <updatepanel UpdateMode="Always"> <ContentTemplate> <asp:FormView> <EditItemTemplate> <table> <tr id='tr1'> <td> Textbox1 btn1 </td> </tr> <tr id='tr2'> <td> ...

How would you refactor this to make it nicer?

How would you refactor something like this? protected void btnAdd_Click(object sender, EventArgs e) { try { string username = txtUsername.Text.Trim().ToLower(); string password = txtPassword.Text.Trim().ToLower(); string email = txtEmail.Text.Trim().ToLower(); string status = ddlStatus.SelectedVal...

What is the most efficient and performant logging solution for ASP.NET?

I want to add logging to the ASP.NET 2.0 web site that I've inherited from a previous developer. The application just spits out exceptions when they occur, and there's no record of financial transactions that have executed. I've been looking at Log4net, which I've used in the past, as well as NLog and BitFactory. What I really need to...

Changing name of viewstate

I have two ASP.NET form living in the same page. I some problems because the hidden fields below get the same name and id. Is there some way I can change these for one of the forms? (They are also not optimal for validation). I need the services the viewstate provides, but perhaps I could disable it on form level, and use it at a lo...

Displaying information with fields and values: ListView, GridView, FormView???

I just want to show some data for a user (name, email, address, identifier, entry date) on an asp.net page. Which ASP.NET control would be the most suited for this? ...

How to create a "Processing" page?

Can someone tell me how to create to a "Please Wait" page. When the pageload is complete, the default.aspx page shows up. Is there a way to do that? I do not want processing images or anything like that. The actual page would be what I would want. ...

Automatic Event Wiring in Global.asax

I'm wondering if there's a way to automatically stub in the Global.asax's event handlers? Thus far, I've not been able to find any examples of how to do this. Seems I have to just find the list of delegate names available to me and type them in manually. Intellisense doesn't seem to lend any useful info on the subject either. ...

Where can I find a .NET datagrid that performs updates and inserts out of the box?

Is there a built-in grid that I could do the following simply: SELECT * FROM MYTABLE It would list all the rows, with paging support. Allow me to update/delete/insert a row by double clicking on it and making it editable etc. Does this exist? Does it require me to write any code to perform the CRUD operations? (any version of ASP.N...

Not Changing Header Text Color In Gridview through using CSS

Hello Friends I am using asp.net c#. I am using gridview to display the data. i am controlling all formating through CSS. In gridview i have define itemtemplate + edititemtemplate + footertemplate and doing sorting through bind column at template field. My problem is the column name which dispalay as header that color is not changed thr...

Best practice: Asp.net WebApp requires user authentication - what to do during development to avoid logging on again and again?

When I develop an ASP.Net webapp, it almost always requires some kind of authentication - ie. the user must log in for stuff to work. But when I am developing it, I don't want to have to log in every time I make a change to some code. So right now for instance, I have a codeblock in my login.aspx, that automatically authenticates me as...

Can I call ASP.NET RegSQL from code?

Is it possible to call (the equivalent of) aspnet_regsql.exe from managed code? My idea is to create a class to automagically build the database for an installed web app, which uses the ASP.NET Membership provider. I could probably call aspnet_regsql.exe direct from code, but I came across the RegSql class(http://msdn.microsoft.com/en-...

ASP.net RequiredFieldValidator not preventing postback

I have a question about what could stop a RequiredFieldValidator from preventing a postback. I began working on an older, but simple aspx form and my predecessor used manual, server-side form validation (checking to see if some form fields have a value and if not displaying an error message in a label). I thought I'd clean out some unn...