Friday, August 17, 2012

IUnlockJoy I build amazing Windows Phone Apps event –11th August rocks!!

Last Saturday ,11th August Microsoft and Ahemdabad .NET user group has organized the IUnlockJoy I build amazing Windows Phone Apps  event. It was first in india as IUnlockJoy campaign was just launched by Microsoft before 3 days. It was superb and well organized thanks to Dhola Mahesh, Prabjhot Baxi,Kaushal Bhavasar and Pranjal Nigam.



It was a great event with almost 100+ people during holiday. Event was started by a keynote speaker Mahesh Dhola. He introduced IUnlockJoy- I build amazing Windows Phone Apps campaign and some of benefits of it.


VIS_8584

After his session Prabjhot singh Baxi has taken a session about how you can get best out of windows phone. He has describe all the process from opening a developer account to publish an app to market place. The session was full of information and I really enjoyed it.
Share:
Saturday, July 28, 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="submit" value="Upload Image" />
}

In above code that I have use @HTML.BeginForm to create a HTML form with multipart as this attribute is required to upload any kind of files on the server. I have mapped that form to upload action result. Also I have used the file input control with HTML5 multiple attribute which allow us to upload multiple files on the server. Now its time to write code in asp.net mvc controller. Following is a code for that.
Share:
Tuesday, July 17, 2012

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 community things. People will know that you are having such knowledge in respected fields. I have got Microsoft Most Valuable Professional award 3 times due to my blogging and community work. But remember one thing your first intension of doing communication work is to help people. All other things will come as other benefits.

Communication skills:

Once you communicate with lots of people and write blog it will definitely increase your communication skills. If you are writing some blogs then its going to increase your writing skills also.
Share:

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 proper time in page life cycle and bind the data.

So what we are waiting for ? let’s take one example. First we need to create a model. For the this I have created a model class called ‘Customer’. Following is code for that.
Share:
Thursday, July 12, 2012

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.

Visual Studio 2012 feature list - What's new in Visual Studio 2012

Following is a quick list of features they have explored in Visual Studio 2012.
  1. JavaScript Intellisense
  2. CSS Intellisense
  3. ASP.NET and ASP.NET Web API
  4. Strongly typed data binding
  5. Page Inspector(new Debugging Tool)
  6. HTML5 and CSS3 is available out of box
  7. Request validation prevents yellow screen of death
  8. WAI Aria makes the web usable by all
Share:
Saturday, July 7, 2012

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.

<configuration>
 <appSettings configSource="AppSettings.config"/>
 <connectionStrings configSource="ConnectionStrings.config"/>
</configuration>

And you could have your ConnectionStrings.config file like following.
Share:
Tuesday, July 3, 2012

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
.
Event handler generation in visual studio 2012 - What's new in visual studio 2012

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

Support this blog-Buy me a coffee

Buy me a coffeeBuy me a coffee
Search This Blog
Subscribe to my blog

  

My Mvp Profile
Follow us on facebook
Blog Archive
Total Pageviews