Contents tagged with ASP.NET Tips and Tricks
-
443 <--> 80 - Seamlessly moving requests in and out of SSL
Sometimes you feel secure, sometimes you don’t. Better put, sometimes a page needs to be secured and sometimes it does not.
-
ASP.NET: Application level data caching with callbacks
In my current application, the vast majority of the web site is broken into content ‘parts’ that can all be edited through a built in content manager. Pages consist of one or multiple parts which are elements of HTML persisted to the SQL database. In order to improve performance I wanted to look at some techniques for caching these content elements and coupled with my desire to learn new things I decided to use the Cache class directly instead of the more common methods of Output Caching.
-
ASP.NET TidbiTIP #3
HOWTO: Cause a page to escape any frames it may be embedded within
-
ASP.NET TidbiTIP #2
HOWTO: Use server side code to set focus onto a control on the client side...
-
ASP.NET TidbiTIP #1
HOWTO: Push a javascript alert using server side code
-
Server Controls - avoiding cc*:somecontrol
I have noticed a number of server controls people have put together lately, some commercial but most free on places like Code Project that always render out with the generic tag prefix. It occured to me that the control of this is not readily obvious so maybe I should be kind and point out that you can change this. Lets suppose I was a commercial control vendor named 'Some Company' and wanted to have the prefix 'soc' for my server controls. I would use something called the TagPrefixAttribute to force this behavior. By placing this code in my AssemblyInfo.cs file I get the desired affect.
-
Giving the user what they want!
[UPDATE]
Scott pointed out the the fact that you can force file names in a download using content-disposition. This is probably the easiest way but the solution listed below will allow you to call to files that do not exists; ie KentuckyThirdDistrict.xls?querystringcrap and the file will download as KentuckyThirdDistrict. Oh well, I did it the hard way :) -
ASP.NET: Windows Authentication on SQL Server
Many of you know that Microsoft suggests using the security provided by inherent windows auth when logging into SQL Server from an ASP.NET application. With Windows 2000 this usually means adding the ASPNET user to SQL Server or the NETWORK SERVICE user for Windows 2003. This is all fine except when you are faced with authenticating against a SQL instance that is not local. It is at this point that most developers usually give up and use SQL authentication. Those who Google the problem however will be presented with a solution that advises a change to the machine.config processModel element. Here you will specify a username and password other than the default MACHINE/AutoGenerate pair.
-
REQ: ASP.NET Feature
For web.config files