asp.net

Using both 1.1 and 2.0 frameworks on Windows 2003 x64

So, much to my annoyance I discover (after lots of research), that when running 1.1 and 2.0 dot.net frameworks on a 64bit 2003 install, it removes the asp.net tab from the IIS properties. I've tried the registry hacks, I've tried registering 32bit versions of both frameworks, and no luck. My only work around is running the excellent AS...

Disabling Back button on the browser

I am writing an application that if the user hits back, it may resend the same information and mess up the flow and integrity of data. How do I disable it for users who are with and without javascript on? ...

passing or reading .net cookie in php page

Hi I am trying to find a way to read the cookie that i generated in .net web application to read that on the php page because i want the users to login once but they should be able to view .net and php pages ,until the cookie expires user should not need to login in again , but both .net and php web applications are on different servers ...

Anyone have sample code for a UserControl with pager controls to be used in a GridView's PagerTemplate?

I've got several Gridviews in my application in which I use a custom PagerTemplate. I'd like to turn this custom template into a UserControl so that I don't need to replicate the same logic in multiple pages. I'm pretty sure that such a thing is possible, but I'm unsure of how exactly to wire the UserControl to the Gridview's events, and...

How best to make the selected date of an ASP.NET Calendar control available to JavaScript?

How best to make the selected date of an ASP.NET Calendar control available to JavaScript? Most controls are pretty simple, but the calendar requires more than just a simple document.getElementById().value. ...

How do you guarentee the ASPNET user gets assigned the correct default directory rights.?

I seem to make this mistake everytime I set up a new development box. Is there a way to make sure you don't have to manually assign rights for the ASPNET user? I usually install .Net then IIS, then Visual Studio but it seems I still have to manually assign rights to the ASPNET user to get everything running correctly. Is my install order...

Using the same App_Code classes across websites

Let's say you have a solution with two website projects, Website A and Website B. Now inside Website A's App_Code folder, there is a Class X defined in a ClassX.cs file. What do you do if Website B also needs access to ClassX.cs? Is there any way to share this file across App_Code folders? Assume that moving the file to a common li...

does elmah handle caught exceptions as well

I was wondering if something like elmah logged exceptions even when they do not bubble up to the application? I'd like to pop up a message when an exception occurs and still log the exception. Currently I've been putting everything in try catch blocks and spitting out messages, but this gets tedious. ...

Is there an elegant way to compare a checkbox and a textbox using ASP.NET validators?

I have an Asp.Net repeater, which contains a textbox and a checkbox. I need to add client-side validation that verifies that when the checkbox is checked, the textbox can only accept a value of zero or blank. I would like to use one or more of Asp.Net's validator controls to accomplish this, to provide a consistent display for client s...

ISS error CS0433: name collision

In our application we've run into an error numerous times where we get error CS0433, which complains about a name collison in two separate dlls. This is an ASP.NET app developed in C# using webforms. It always complained about A TimeLog page. Anyone have advice for resolving this error? ...

Best way to convert a decimal value to a currency string for display in HTML.

I wanting to show prices for my products in my online store. I'm currently doing: <span class="ourprice"> <%=GetPrice().ToString("C")%> </span> Where GetPrice() returns a decimal. So this currently returns a value e.g. "£12.00" I think the correct HTML for an output of "£12.00" is "&pound;12.00", so although this is rendering fi...

What Is ASP.Net MVC?

When I first heard about StackOverflow, and heard that it was being built in ASP.Net MVC, I was a little confused. I thought ASP.Net was always an example of an MVC architecture. You have the .aspx page that provides the view, the .aspx.vb page that provides the controller, and you can create another class to be the model. The process...

Disable (Politely) a website when the sql server is offline

I work at a college and have been developing an ASP.NET site with many, many reports about students, attendance stats... The basis for the data is a ms sql server db which is the back end to our student management system. This has a regular maintenance period on thursday mornings for an unknow length of time (dependent on what has to be ...

Do you think ASP.NET MVC will compete with ASP.NET Webforms?

Do you think ASP.NET MVC will ever have a significant share of the Microsoft web development market? Or will it be more like 10-15% of the market? ...

Autocomplete Textbox on Gridview editing

How do you implement autocomplete on ASP.Net Gridview? Can anyone point me where to go to achieve this? I'm willing to use non-.Net ajax controls if that what it takes. ...

Whats a good way to trim the GUI of a ASP.NET website?

I've been trimming the UI of our website by doing the following in the onload event of that control: btnDelete.isVisible = user.IsInRole("can delete"); This has become very tedious because there are so many controls to check again and again. As soon as I get it all working, designers request to change the UI and then it starts all ov...

Reference app relative virtual paths in .css file

Assume I have an "images" folder directory under the root of my application. How can I, from within a .css file, reference an image in this directory using an ASP.NET app relative path. Example: When in development, the path of ~/Images/Test.gif might resolve to /MyApp/Images/Test.gif while, in production, it might resolve to /Image...

How to Naturally Sort a DataView with something like IComparable

Hey Guys, My DataView is acting funny and it is sorting things alphabetically and I need it to sort things numerically. I have looked all across the web for this one and found many ideas on how to sort it with ICompare, but nothing really solid. So my questions are How do I implement ICompare on a DataView (Looking for code here). ...

IIS URL Rewriting vs URL Routing

I was planning to use url routing for a Web Forms application. But, after reading some posts, I am not sure if it is an easy approach. Is it better to use the URL Rewrite module for web forms? But, it is only for IIS7. Initially, there was some buzz that URL routing is totally decoupled from Asp.Net MVC and it could be used for web form...

How do I create a sql dependency ona table in sql server 2000 and asp.net 2.0?

I need to create a sql dependency on a table in sql server 2000 in my asp.net 2.0 pages. What are the required actions and what is the best way? ...