asp.net

Custom TextBox Control And Validation Display

Hi, I have created a custom TextBox control which also contains a RequiredFieldValidator. Everything works fine but the problem is in display. The display is something like this: [TextBox Control] [Validation Error Message] I want the display to be something like this: [Validation Error Messsage] [TextBox Control] (the validati...

Why did ASP.NET generate the same cookie key for a domain and subdomain?

Bug: I've got an ASP.NET web application that occasionally sets identical cookie keys for ".www.mydomain.com" and "www.mydomain.com". I'm trying to figure out what default cookie domain ASP.NET sets, and how I accidentally coded the site to sometimes prepend a "." to the cookie domain. When 2 cookies have the same key and are sent up f...

AntFarm anti-pattern -- strategies to avoid, antidotes to help heal from

I'm working on a 10 page web site with a database back-end. There are 500+ objects in use, trying to implement the MVP pattern in ASP.Net. I'm tracing the code-execution from a single-page, my finger has been on F-11 in Visual Studio for about 40 minutes, there seems to be no end, possibly 1000+ method calls for one web page! If it wa...

Webforms App Layout Opinions?

...

Anyone have any cool code snippets

Code snippets are a pretty underused feature in Visaul Studio and it can really save you alot of time. What custom code snippets do you guys use in your everyday coding? Let me list some of mine: vprop - view state property ane - argument null exception event - definition for an event handler noe - expands into String.IsNullOrEmpty(...

HTML document to PDF?

I've got an ASP.NET web page that is a dynamically generated report. For business reasons, this exact report needs to be produced as a PDF. What's the best way to do this? Setting the selected printer to Adobe PDF is not an option. Learn to programmatically create PDFs from scratch? Is there a way to render it in some browser control, t...

How do I check if a page is bookmarked

Without resorting to using an ActiveX or some other kind of client side coding: Is it possible to determine if a visitor to a website arrived to a page via his bookmarks or the home page? Personally I think its impossible, but I would like to be sure or proven wrong. The way I am doing something like this at the moment is: Request.Ur...

How to read multiple records in XML doc

I can read one record from Xml just fine with some code I have, but how do you read multiple in an xml file such as so: <?xml version="1.0" encoding="UTF-8"?> <XXX_XXX_response xmlns="http://XXX.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://XXX.com/1.0/ http://XXX.com/1.0/XXX.xsd" list="true...

What are the ways to find bottlenecks in a web application?

How do I benchmark the performance of my web applications? Is there a way to find out the bottlenecks in a web application? EDIT: I am not asking about any front end tweaks like images, css etc. What I want to know is how to profile the back end of the application so that I will know which methods/queries to modify to increase the perf...

Listen to events: in HTML from .NET

Hi guys, Let's say that in the HTML with the help of an UpdatePanel I have the "loading" animated gif running while ASP.NET is processing data from a webservice. I'm just wondering if there is a way to implement an Event in the .NET code that can be listen from the HTML code, like: I'm requesting Persons data from a WebService, one by...

Find All ContentPlaceHolders in a MasterPage ASP.Net

I have to find the IDs of all the contentPlaceHolders in a MasterPage. ...

Visual Studio 2008 SP1 crash when opening MVC View

I have Visual Studio 2008 SP1 and ASP.NET MVC RC installed on a XP SP2 machine with .NET Framework 3.5 SP1. (That's a lot of SP's in one sentence!) I've a ASP.NET MVC project that I can edit just fine with Visual Web Developer Express. But opening a View page in Visual Studio 2008 SP1 makes Visual Studio to crash and vanish without even...

AJAX.NET request handlers - set hidden field

Hi, I'm trying to set the value of a hiddenfield control in an AJAX initialize request handler. However on the server the hidden field control always contains the value for the previous postback. I presume the viewstate is being prepared / send before I set the hidden field in the initialize request handler. Is there any way to set the h...

VS 2008 "Unable to connect to the ASP.NET Development Server"

I have VS 2005 and VS 2008 installed side by side. It is interesting that I can use development server under VS 2005. But when I tried in VS 2008, it gave me an error "Unable to connect to the ASP.NET Development Server". Any idea? Thanks! ...

How to bind a List<Int> to a gridview?

This might be quite a strange question since usually people bind to gridview only complex types. But I need to bind a List of Int (the same is for strings). Usually, as property to bind one uses the name of the property of the object, but when using a Int or a String, the value is exactly the object itself, not a property. Any idea of w...

How do I create a thread that runs all the time in the background in a .net web site?

I intend to build a small web site that will poll a third party web service, say every 15 minutes, store the collected data in a db and display the results via web pages. I want the polling to run 24 hours a day with or without anyone visiting the web site. I know I could create a stand alone application that could run on the server ...

De-cluttering ASP.NET javascript

Hi, I'm just getting into ASP.NET Been avoiding it for years as I'm a desktop application advocate. Anyway, I was wondering if there's a way to stop the generated html being so cluttered with javascript. Is there a way to make the generated script go into a referenced js file rather that inline with the page. ...

Dynamically Loaded ListButton's and PostBack Event

Hi, I am trying to get a dynamically loaded LinkButton to fire a postback event, which I then handle. I have across Command, CommandName and CommandArgument - which looked real useful.. So I started messing with that, but currently cannot get to work as desired. The links are rendered within a table that is created on the fly, here is ...

need wcf and wpf application source code for beginer

Hi, I am beginner for .net 3.5, have to work on app where I need to build desktop version as well as web version for selected modules like reporting. I think WCF will help me out to create a base from where I could call functions in both(desktop as well as web ) Please let me know the any available source code sample projects to go thr...

how to send user ID across differnet application in ASP.Net?

Hello everyone, I have two web applications all are developed by ASP.Net. Now I want to provide a feature which enables the user to click from one URL in application site (one virtual directory of IIS) A to the other URL in application site B (another virtual directory of IIS). I have two ideas to implement them, but both of them have ...