asp.net

Tool to calculate # of lines of code in code behind and aspx files?

Looking for a tool to calculate the # of lines of code in an asp.net (vb.net) application. The tricky part is that it needs to figure out the inline code in aspx files also. So it will be lines of code in vb files (minus comments) plus the inline code in aspx files (not all the lines of aspx files, just the code between <% %> tags. ...

Dynamically added controls in Asp.Net

I'm trying to wrap my head around asp.net. I have a background as a long time php developer, but I'm now facing the task of learning asp.net and I'm having some trouble with it. It might very well be because I'm trying to force the framework into something it is not intended for - so I'd like to learn how to do it "the right way". :-) M...

When to enable/disable Viewstate

I generaly disable viewstate for my ASP.net controls unless I explicitly know I am going to require view state for them. I have found that this can significantly reduce the page size of the HTML generated. Is this good practice? When should be enabled or disabled? ...

using dotnetnuke (dnn) with with subversion.

Currently i am developing sites using DNN framework. Currently my development and staging environment is same. Client is vewing same site which I am using for development. I have started using tortoise svn (subversion) for maintaining versions and backup. I am using file based svn repository for it. The issue is svn creates .svn folder...

Get Performance Counter Instance Name (w3wp#XX) from ASP.NET worker process ID

Hello, I would like to display some memory statistics (working set, GCs etc.) on a web page using the .NET/Process performance counters. Unfortunately, if there are multiple application pools on that server, they are differentiated using an index (#1, #2 etc.) but I don't know how to match a process ID (which I have) to that #xx index. ...

ASP.NET MVC Preview 5 - Html.Image helper has moved namespace

We've just updated ASP.NET from Preview 3 to Preview 5 and we've run into a problem with the Html.Image HtmlHelper in our aspx pages. It seems that Html.Image has moved from System.Web.Mvc into Microsoft.Web.Mvc, and the only way we've found to access the helper now is to add an import statement to every .aspx page that uses it. All the...

Loading DLL from a /bin directory

I have created a web project which references a class library project. When deployed to the local machine the web/classes all work fine but deployed on a ‘shared’ IIS site, the class DLLs exist in the /bin directory, but the web page generates the following error: can’t find file “Documents and settings/….” when trying to access the ...

How to list some specific images in some folder on web server?

Let me explain: this is path to this folder: > www.my_site.com/images And images are created by user_id, and for example, images of user_id = 27 are, 27_1.jpg, 27_2.jpg, 27_3.jpg! How to list and print images which start with 27_%.jpg? I hope You have understand me! PS. I totally beginer in ASP.NET (VB) and please give me detailed infor...

How can I share a variable value between classic asp, .NET and javascript?

Hello, I've created an IHttpHandler in .NET C# which returns pieces of html to a classic asp page. The classic asp page communicates with the IHttpHandler through basic http requests using ServerXMLHTTP in vbscript or Ajax Calls in JavaScript. Now, I need a way to share a variable which I have in vbscript but not in javascript with th...

Http Exception generated while validating viewstate

I am getting the following error whenever I click on a postbacking control HttpException (0x80004005): Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. I am not u...

Are there any utilites that will help me refactor CSS

I am working with some CSS that is poorly written to say the least. I am not a design/CSS expert, but I at least understand the C in CSS. While the built in CSS support inside of VS-2008 is far improved over previous versions, it still doesn't quite do what I am looking for. I was wondering if anyone knew of a good program or utility th...

HTML Tag ClientID in a .NET Project

If I want to manipulate an HTML tag's properties on the server within an aspx page based on a master page i.e. <a href="#" runat="server" ID="myLink">My Link</a> For example to give the link a different class depending on the current page i.e. if (Path.GetFileName(Request.PhysicalPath) == "MyPage") { myLink.Attributes.Add("class","a...

Hide asp.net Gridview row

I am creating a gridview that allows adding of new rows by adding the controls neccessary for the insert into the footertemplate but when the objectdatasource has no records I add a dummy row as the footertemplate is only displayed when there is data. How can I hide this dummy row? I have tried setting e.row.visible = false on RowDataBo...

ASP.NET: How do I create radio buttons and databind them in a DetailsView?

I have a TemplateField in a DetailsView and its input should be one of a few choices in a lookup table. Currently it's a text field, but I want it to be a group of radio buttons, and it should work in both insert and edit mode (the correct current value should be selected in edit mode). How do I create mutually exclusive radio buttons a...

Adding custom headers

Hi, I need to create and add custom headers to an ASP.NET 2.0 application. The case is simulation of an SSO-login in our dev/test environment. When I try to add headers I run into the "Not supported on this platform." error. BigJim has a nice post on the subject here: http://bigjimindc.blogspot.com/2007/07/ms-kb928365-aspnet-requesth...

Stress-testing ASP.NET/IIS with WCAT

I'm trying to setup a stress/load test using the WCAT toolkit included in the IIS Resources. Using LogParser, I've processed a UBR file with configuration. It looks something like this: [Configuration] NumClientMachines: 1 # number of distinct client machines to use NumClientThreads: 100 # number of threads per mach...

Recomendations for ASP.Net integratable Web CMS

I have a website that includes a home grown CMS system. We are looking for a stronger CMS solution but one that we can integrate into our existing architecture. A CMS that needs to 'own' the whole page is not going to work for us. We wish to have ASP.Net control the pages but insert dynamic content. We are particularly looking to impr...

What are your experiences with Windows Workflow Foundation?

I am evaluating WF for use in line of business applications on the web, and I would love to hear some recent first-hand accounts of this technology. My main interest here is in improving the maintainability of projects and maybe in increasing developer productivity when working on complex processes that change frequently. I really like...

When should I use # and = in ASP.NET controls?

I have been using ASP.NET for years, but I can never remember when using the # and = are appropriate. For example: <%= Grid.ClientID %> or <%# Eval("FullName")%> Can someone explain when each should be used so I can keep it straight in my mind? Is # only used in controls that support databinding? ...

RegisterStartupScript on Logout page

I am trying to have a logout page where is displays a messages and then redirects to the login page. This is in ASP.net 2.0 I have this in my Page_Load ClientScript.RegisterStartupScript(typeof(Page), "pageredirect", JavascriptRedirect()); This is my redirect function: private string JavascriptRedirect() { StringBuilder sb = new ...