Archive for July, 2011

Disable browser cache in asp mvc

Friday, July 29th, 2011

Here is a simple trick on how to disable browser cache in your asp .net mvc application with an attribute. If you have a base controller just add this to your base and all your request would have Pragma No-Cache ?View Code CSHARP1 2 3 4 5 6 7 8 9 10 11 12 13 [...]

Share

Enable https on ASP.NET MVC 2 & 3, through Filters and web.config

Tuesday, July 26th, 2011

To enable SSL on asp.net mvc, one can use the [RequireHttps] attribute on the base controller if you are using a base controller ?View Code CSHARP1 2 [RequireHttps] public class BaseController: Controller But what if you want to give an option to the installer or the client to enable it in web.config, the easy way [...]

Share

Jquery: dropdown.val(‘selected’, ‘selected’) does not work anymore.

Monday, July 25th, 2011

Was debugging some code that was broken due to jquery 1.6 update, and found this call. ?View Code JAVASCRIPT1 $("#dropDownSelect option[text=" + myText +"]").attr("selected","selected") ; Not working anymore but a simple fix of changing it to ?View Code JAVASCRIPT1 $("#dropDownSelect option[text=" + myText +"]").prop("selected",true) ; This does the trick, for more on prop take a [...]

Share

Building an installer and displaying Data Link Properties Dialog Box for connection string

Wednesday, July 20th, 2011

So was hacking a new installer and wanted to display the data link properties dialog, for building a connection string. Here is what I have found out by playing with it. One has to add the reference to ADODB.DLL (from .NET reference) and Microsoft OLE DB Service Component 1.0 Type Library from the COM tab [...]

Share