Geeks With Blogs
Łukasz Kuryło's blog ASP.NET MVC
Accessing Session object from custom handler

By default, when you want access to Session object from http handler you have beautiful exceptions thrown.

This is probably from performance reason. But there is very simple solution to fix it.

Everything to do is to implement a IRequiresSessionState marker interface.

Posted On Sunday, November 14, 2010 12:34 AM / mvc snippets
Download a remote file using ASP.NET Download a remote file using ASP.NET 1: public bool DownloadFile(string url, string downloadFileName, 2: string directoryToSave, out Exception exception) 3: { 4: string fileName = downloadFileName; 5: bool result = false; 6: exception = null; 7: 8: if(String.IsNullOrEmpty(url)) 9: { 10: throw new ArgumentNullException("url"); 11: } 12: 13: if (!String.IsNullOrEmpty(dire... 14: { 15: if (!Directory.Exists(Server.M... 16: { 17: throw ......

Posted On Monday, October 5, 2009 10:06 PM

Downloading a file from, this is a polish site similar to youtube. It allows to watch movies and listen to music, but does not allow direct downloading them to disk. In this post I would like to show how to achieve that using Ext JS and MVC. Create a new ASP.NET MVC project and add there a Ext JS library. I have written here how to do that. First step is create a form where user can paste the url. Ext.onReady(function() { Ext.QuickTips.init(); var form = new Ext.form.FormPanel({ frame: true, renderTo: 'form', ......

Posted On Sunday, September 27, 2009 9:20 PM

How to upload a file using Ext JS to the ASP.NET MVC page
In this short article I would like to show how to upload an image file to the server using Ext JS library and ASP.NET MVC. First step is create a new ASP.NET MVC project and add to him the Ext JS library. I have written here how to do it. We will use a user extension called Ext.ux.form.FileUploadField to upload a file. It is not included in the library, so add to project these files: - FileUploadField.js - FileUploadField.css Now let’s add a new form with the fileuploadfield field Ext.onReady(function() ......

Posted On Saturday, September 5, 2009 2:11 PM

Integration Ext JS and ASP.NET MVC
This is a part of EXT JS Tutorial To successfully carry out everything that has been described in this article you need: Normal 0 21 false false false PL JA X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:Standardowy; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.000... line-height:115%; ......

Posted On Tuesday, August 25, 2009 4:38 AM

Own RSS/Atom feed in ASP.NET MVC
Create a rss or atom feed is very simple in mvc. In V1.0 there isn’t a build-in mechanism to work with feeds, however we can very quickly build our own. All we have to do is create a xml structure accordance with their specification and new ActionResult derived class to handle the result. But let’s start form beginning. The first of all, we need to create a new MVC project and call it e.g. RssFeed. The data for feeds will be taken from database, so we have to build model. Let’s create a new ......

Posted On Sunday, August 23, 2009 8:23 PM

Copyright © Łukasz Kuryło | Powered by: