Skip to main content

Posts

Showing posts from July, 2012

Multiple file upload with asp.net mvc and HTML5

Few days I have written a blog post about Multiple file upload with asp.net 4.5 and Visual studio 2012. It was greatly appreciated by the community and also been part of www.asp.net community daily spot light.  On that post one of my reader Ciwan Kurd has requested the asp.net mvc version of that post. So in this post I will explain how we can do multiple file upload with HTML5.

For this post I am going to use asp.net mvc 3 with HTML5 template and visual studio 2012 but you can use same techniques in any version of asp.net mvc.  First things we needs to do create a HTML form for the uploading file in asp.net mvc view so following is a code for that.

@using (Html.BeginForm("Upload", "Home", FormMethod.Post, new { enctype = "multipart/form-data" })) { <label for="file">Upload Image:</label> <input type="file" name="files" value="" multiple="multiple"/> <input type="subm…

Why we should write blogs and do community work

I am doing blogging since last 5 years and I have seen lots of people asking the same things. Why do you write blog? do you have any side income for this blog? Why you are so active in community ? I am answering this questions almost every day. So I decided to write a blog post about it. Following are the reason why I am writing blogs and doing community work?

Help: I like to help people and that is one of the main reason behind the all blogs and community work. Also helping other is a great way to learn new things. Because other person may be facing a problem which you never encountered during your professional life or project you are doing!!. At the end of you can feel proud that you help somebody.

Learning:I have to learn lots of things everyday to write my blogs. Some one said Teaching some one is best way to learn new things. It apply here also when you write blog or answer question on forum.

Earn Award and Get famous:This is one of the advantages of writing blogs and doing com…

Model binding with ASP.NET 4.5 and Visual Studio 2012

Note:I have written a whole series of Visual Studio 2012 features and this post will also be part of same series. You can get the whole list of blogs/articles from the Visual studio 2012 feature series posts there. Following is a link for that.Visual Studio 2012 feature series In earlier version of the asp.net we have to bind controls with data source control like SQL Data source, Entity Data Source, Linq Data Source if we want to bind our server controls declaratively. Some developers prefer to write whole data access logic and then bind the data source with databind method. Model binding is something similar to asp.net mvc binding.

Model Binding in ASP.NET 4.5 and Visual Studio 2012:
With ASP.NET 4.5 and Visual studio 2012 we have a new method of binding data called ‘ Model binding’. It’s a code focus approach of data binding. Now all the controls will have ItemType property which will implement strongly type binding. The server controls will then call appropriate methods at the…

Free Visual Studio 2012 eBook from Telerik

Note:I have been writing lots of things about Visual Studio 2012 and this post is same in the series. You can find complete list of post from the following link.Visual Studio 2012 feature series- What’s new in Visual Studio 2012. Visual studio 2012 is there in RC stage and I am exploring that into the great extent. Visual Studio 2012 is great editor there is no doubt. It is much more mature and comes with lots of features. Telerik – A well know in third party controls released a free eBook on Visual Studio 2012 and ASP.NET 4.5. You can find lots of time saving feature documented in this eBook.



Following is a quick list of features they have explored in Visual Studio 2012.
JavaScript IntellisenseCSS IntellisenseASP.NET and ASP.NET Web APIStrongly typed data bindingPage Inspector(new Debugging Tool)HTML5 and CSS3 is available out of boxRequest validation prevents yellow screen of deathWAI Aria makes the web usable by all

Dividing web.config into multiple files in asp.net

When you are having different people working on one project remotely you will get some problem with web.config, as everybody was having different version of web.config. So at that time once you check in your web.config with your latest changes the other people have to get latest that web.config and made some specific changes as per their local environment. Most of people who have worked things from remotely has faced that problem. I think most common example would be connection string and app settings changes.

For this kind of situation this will be a best solution. We can divide particular section of web.config into the multiple files. For example we could have separate ConnectionStrings.config file for connection strings and AppSettings.config file for app settings file.

Most of people does not know that there is attribute called ‘configSource’ where we can  define the path of external config file and it will load that section from that external file. Just like below.

<configurati…

Event handler generation in Visual Studio 2012

Note: This post will be a part of Visual Studio 2012 feature series. There are lots of new features there in visual studio 2012. Event handler generation is one of them. In earlier version of visual studio there was no way to create event handler from source view directly.  Now visual studio 2012 have event handler generation functionality.

So if you are editing an event view in source view intellisense will display add new event handler template and once you click on it. It will create a new event handler in the cs file. It will also put a eventhandler name against event name so you don’t need to write that.

So, let’s take a simple example of button click event so once I write onclick attribute their smart intellisense will pop up
.


Now once you click on <Create New Event> It will create event handler in .cs file like following.

Multiple file upload with asp.net 4.5 and Visual Studio 2012

Note: This post will be part of Visual Studio 2012 feature series. In earlier version of ASP.NET there is no way to upload multiple files at same time. We need to use third party control or we need to create custom control for that. But with asp.net 4.5 now its possible to upload multiple file with file upload control.

With ASP.NET 4.5 version Microsoft has enhanced file upload control to support HTML5 multiple attribute. There is a property called ‘AllowedMultiple’ to support that attribute and with that you can easily upload the file. So what we are waiting for!! It’s time to create one example.
On the default.aspx file I have written following.

<asp:FileUpload ID="multipleFile" runat="server" AllowMultiple="true" /> <asp:Button ID="uploadFile" runat="server" Text="Upload files" onclick="uploadFile_Click"/>
Here you can see that I have given file upload control id as multipleFile and I have set AllowMul…

Third year in a row- Microsoft MVP again!!

Today is Sunday and I was not expecting this as today is holiday although I know it was Microsoft Mvp renewal day. At evening I got the congratulation email from the Microsoft. Yeah!! I am Microsoft Most Valuable Professional again. I got the same message as a part of Mvp. Thanks Microsoft again.

Dear Jalpesh Vadgama,
Congratulations! We are pleased to present you with the 2012 Microsoft® MVP Award! This award is given to exceptional technical community leaders who actively share their high quality, real world expertise with others. We appreciate your outstanding contributions in Visual C# technical communities during the past year.

Feeling is again same as first time. I am going to dedicated this award to my family. My parents who always inspired me to do new things. My wife who scarifies her time to write blogs. My brother who support me in every possible way.

On this occasion, I would also like to thanks my reader without their support it was no possible to achieve this. Thanks for …

Quick tour of visual studio 2012 features so far

Note: I am writing a whole new feature series about Visual Studio 2012 new features. Following is the link for that. I have written couple of post there.Visual Studio 2012 features series. What's new in Visual Studio 2012 I thought it would be great idea to write summary post for this. So this post will be a summary of all the post I have written so far. Here it will describes what’s new in visual studio 2012 and what are the features that I have covered so far. It will be quick of tour of some of the feature in Visual Studio 2012.

Visual studio 2012 first review(Earlier known as Visual studio 2011 beta)
In this post, I have written about the Metro UI of visual studio 2012. It’s totally different then the older version of visual studio 2012. Now its empathize more on code instead of visual appealing things. In this blog post I have also described solution explorer and tool box features also. Following is a link for that.

Visual Studio 2011 Beta First Review(Now known as Visual Studi…