(Microsoft Technologies - ASP.net, ASP.net MVC, WCF,Web Services) (Front-end - React, Angular) Interests: - Project Development and Execution - Working with Microsoft Stack - Cloud computing - Product Building - Contributing to Organization Building - Business Development IT
Wednesday, February 27, 2013
Tuesday, March 13, 2012
Forms in ASP.net MVC 3
The form representation is different in ASP.net MVC as compared to ASP.net.
there is no straight form tag that we were using in other version than MVC.
To create forms we need to user Html Helpers
HTML.Begin Form() method is used to define the form.
@using(HTML.BeginForm()){
// here you can define your form
// I am taking example of a product form
}
on the other hand to handle this form request on post.
you need to add the following code in your product controller :
// I have created a product model in productsModel namespace where I have defined the
// class for product..
[HttpPost]
public ActionResult Create(FormCollection collection)
{
try
{
// TODO: Add insert logic here
MvcAppTutorial.Models.Product myProduct = new Models.Product();
myProduct.ProductName = collection["ProductName"];
myProduct.ProductDesc = collection["ProductDescription"];
ViewBag.ErrorMessage = "Data Saved";
return View();
}
catch
{
return View();
}
}
Next I will show you how to add validations to the form..
there is no straight form tag that we were using in other version than MVC.
To create forms we need to user Html Helpers
HTML.Begin Form() method is used to define the form.
@using(HTML.BeginForm()){
// here you can define your form
// I am taking example of a product form
Product Name
@Html.TextBox("ProductName")
Product Description
@Html.TextArea("ProductDescription")
}
on the other hand to handle this form request on post.
you need to add the following code in your product controller :
// I have created a product model in productsModel namespace where I have defined the
// class for product..
[HttpPost]
public ActionResult Create(FormCollection collection)
{
try
{
// TODO: Add insert logic here
MvcAppTutorial.Models.Product myProduct = new Models.Product();
myProduct.ProductName = collection["ProductName"];
myProduct.ProductDesc = collection["ProductDescription"];
ViewBag.ErrorMessage = "Data Saved";
return View();
}
catch
{
return View();
}
}
Next I will show you how to add validations to the form..
Tuesday, December 20, 2011
Sencha Touch Project Template in Visual Studio 2010
I am starting on web development for mobile devices. I am using Sencha Touch. As I have been working with Microsoft technologies from last 8+ years thus would prefer to use Visual Studio for development.
I found VS Project Template for Sencha Touch.
Here's an article that explains how to do it.
http://mahdi.mp/sencha-touch-html5-p...l-studio-2010/
I have got it Installed and it all looks good to me to get started.
I found VS Project Template for Sencha Touch.
Here's an article that explains how to do it.
http://mahdi.mp/sencha-touch-html5-p...l-studio-2010/
I have got it Installed and it all looks good to me to get started.
Hopefully I will get time shortly to publish Sencha Touch Learning series shortly.
Wednesday, June 29, 2011
Staying Calm important for a Project Manager
We all face certain situations repeatedly in our lives which throw our life out of gear and for a IT Project Manager these kinds of things are routine, say reoccurring in every 3 months or so. The situation could be project running late, or client becomes insolvent or you are to busy or over loaded with other projects that you cannot oversee the things properly and now client is yelling and result of this management has also become indifferent. All the world around you seems to be against you. But this is where a project manager needs to be cautious.
The sudden setbacks can kick your brain out of sort. and could fill it with negative feelings. The first and foremost thing to get back on track is to seize control of your thoughts and feelings to ensure that your are back to your best.
The natural tendency is to react or overreact in a negative way when things go wrong. One will become angry, upset, disappointed, etc..,and all these things will certainly block or shut down major part of your brain especially thinking part of the brain which does analysis and help solve problems and make decisions.
How to Deal with this;
The question that now arises is - HOW TO DEAL WITH THIS?
The answer lies in staying calm in a crisis.
One should take a deep breath to calm your mind and then think carefully about next words and actions.
Imagine that this is a test to see what you are truly made of. Imagine everyone is watching you and observing how you respond. So be a role model and show them the correct way to deal with the situation.
Think of the following quote by Samuel Johnson.
“Things don't go wrong and break your heart so you can become bitter and give up. They happen to break you down and build you up so you can be all that you were intended to be.”
Always tell yourself - You expected things differently then they have came out to be. This is normal things can go wrong but they can be rectified.
As a project manager- My obligation is not only to remain calm in these kind of situations but also to motivate the team to work effectively to resolve the problem
If a Project Manager shows the panic then to keep motivation alive in the team is impossible.
When I am in a situation then I sit back first and look at the things and analyze what went wrong.
I myself is not afraid of admitting if I am guilty and I am willing to do anything to resolve it.
Then I list out things that i need to take care on priority and sit with my team and start working on the priorities.
I sit back with my team and work with them even it takes hours by keeping my self in the things I lead them by example and also ensure that things are going as I wanted them
Instead of reacting I ask question to people and listen to their answers and accordingly make out solution.
The most Important thing is to look something postive in the problem- Like I could be in better position in future if I can challenge my self to resolve things from this point.
This way I ve always been able to motivate my self through out and hope this small article will hold something for others to be useful in tackling the day to day situations effectively.
The article is not about advocating what I am doing but of helping others if they are in same situation.
The sudden setbacks can kick your brain out of sort. and could fill it with negative feelings. The first and foremost thing to get back on track is to seize control of your thoughts and feelings to ensure that your are back to your best.
The natural tendency is to react or overreact in a negative way when things go wrong. One will become angry, upset, disappointed, etc..,and all these things will certainly block or shut down major part of your brain especially thinking part of the brain which does analysis and help solve problems and make decisions.
How to Deal with this;
The question that now arises is - HOW TO DEAL WITH THIS?
The answer lies in staying calm in a crisis.
One should take a deep breath to calm your mind and then think carefully about next words and actions.
Imagine that this is a test to see what you are truly made of. Imagine everyone is watching you and observing how you respond. So be a role model and show them the correct way to deal with the situation.
Think of the following quote by Samuel Johnson.
“Things don't go wrong and break your heart so you can become bitter and give up. They happen to break you down and build you up so you can be all that you were intended to be.”
Always tell yourself - You expected things differently then they have came out to be. This is normal things can go wrong but they can be rectified.
As a project manager- My obligation is not only to remain calm in these kind of situations but also to motivate the team to work effectively to resolve the problem
If a Project Manager shows the panic then to keep motivation alive in the team is impossible.
When I am in a situation then I sit back first and look at the things and analyze what went wrong.
I myself is not afraid of admitting if I am guilty and I am willing to do anything to resolve it.
Then I list out things that i need to take care on priority and sit with my team and start working on the priorities.
I sit back with my team and work with them even it takes hours by keeping my self in the things I lead them by example and also ensure that things are going as I wanted them
Instead of reacting I ask question to people and listen to their answers and accordingly make out solution.
The most Important thing is to look something postive in the problem- Like I could be in better position in future if I can challenge my self to resolve things from this point.
This way I ve always been able to motivate my self through out and hope this small article will hold something for others to be useful in tackling the day to day situations effectively.
The article is not about advocating what I am doing but of helping others if they are in same situation.
Tuesday, March 22, 2011
ASP.net Web Forms Vs. MVC
After working and gaining some confidence in ASP.net MVC. I feel , now I am in a position to write up my views on this topic.
After having worked on Web Forms for over 5 years and before graduating to web forms having experience with classic ASP and VB6.0. I felt the gradual change that brought advantages and after using these changes what disadvantages were felt and change was again introduced and so forth.
Sticking to the principle – “Change is inevitable”.
Sticking to the principle – “Change is inevitable”.
When I started on web programming, and having worked as vb6.0 developer for windows applications, the first choice was to go for Microsoft technology. So I started with ASP 3.0. VB6.0 was involved as programming so was easy to learn with some principle fundamentals of POST and GET and Form collections with HTML and Java Script.
After working on few projects I felt the need that as the project grows, while developing in ASP the managing of the project becomes difficult. There was not structure or pattern defined, but we still follow to use include folder to contain asp pages that we needed to include. Handling actions were difficult and sometimes hard to debug, which consumed most of the time. Having graduated to web programming after spending 2+years in Window application development, always felt the need for event driven programming for web.
Microsoft then introduced revolutionary .net platform. With .net platform came ASP.net 1.1. This was a complete makeover from vb6.o to fully object oriented VB and introduction of C# as programming languages which is object oriented. In ASP.net the web programming was devised on web form technology, which was similar to event driven programming that we followed in windows application development for Visual Studio 6. You just need to understand and handle the post back and you can easily code in ASP.net.
There was no include needed, and neat separation of Design and code file was introduced. The design is in .aspx file and code is in .aspx.cs or .aspx.vb file. This brought the much needed code and design separation for better code management. Along with this advanced data bound controls and binding technology was introduced with ADO.net.
Web Forms completely changed the way web programming was done and introduced RAD (Rapid Application Development) in web development.
But as said change defies the earlier disadvantages, but use of this brings up other change needs.
With introduction of AJAX, things again changed in web programming stage. There was need for reducing the post backs to the server and enhancing the user experience.
Microsoft, always wanted there developers to enjoy the RAD advantage, introduced AJAX Control tool kit. Which has the update panel, which took care of the details of the ajax implementation. But there is a big performance issue related. The page usually took ages to get update, as behind the scene whole page got post back to the server . Thus this invoked the need to handle the ajax using some generic methods. Secondly, server side controls provided the rapid way of doing things, but if the application demanded some customization then it used to take more time then what it took for development.
Various patterns were introduce to follow the programming. Which was needed for further abstraction of the code when the application complexity increases. But the following of the patterns has not been consistent, there are ways to tweak through the pattern following.
Other problem was use of viewstate. The Web form s were dependent of viewstate, that kept the data for the server control in use. Even the viewstate data is in encrypted form but their existence makes the page heavier and some what compromises the data security.
Also with the introduction of JQuery, things changed rapidly and demand for light weight pages with multiple functionality and generic, smooth and efficient Ajax implementation increased. Microsoft , keeping in consideration of the need for change and demand, introduced MVC pattern for web development.
MVC is not the replacement for web form but another way of getting things done. But you will need to know in which project you need to follow MVC or Web Forms.
If your project is complex and involved the modules that needs testing before implementation, then MVC is the best. As MVC provides TDD – Test Driven Development , where developer can test the Action inside the controller before implementing the view.
Another advantage of MVC is the strict following of Model View Controller. There is not tweak available. The pattern is followed in strict consistent manner.
Usage of JQuery has enhanced the user experience and through jquery many things are possible which other wise using Web Forms would have been very difficult.
Eradication of viewstate has made the page lighter.
But still ASP.net MVC is not the substitute of Web Forms. If the application in consideration is to be developed in quick turnaround time or it does not involves much complexity then developers should prefer for web forms hands down.
I know the above is not the sufficient information, which answers this question. But I have tried sincerely to find this. I will keep myself and this blog updated with more information as needed.
Looking for comments on this.
Sunday, November 15, 2009
How Web Application Works?
A web application is different from window application, in many ways. First and foremost difference is this, that web application does not run on a single thread as window application runs. Second main difference is to run window application there’s an executable file which runs the application, but to run a web application, browser application executable is used, i.e to work with web application, you need a browser, through which you can use web application, so there is a dependency of browser application to run web application on users system.
There are two key players in running the show for the web application are: Web Browser and Web Server.
Web Browser works on user (client ) side and Web Server works on Server Side. The following steps are usually involved in the communication process between browser and web server are as follows:
1. A user initiates a request by typing in a url in address bar of the web browser (say: http://www.yahoo.com).
2. A request is send to the web server using HTTP protocol, and GET method to web server hosting the web application.
3. The Web Server (Yahoo.com web server), processes the request, as this request is for default page (Home Page), retrieves the code for the default page, and run it.
4. After running the code, the output produced is in the form of html and java script, which is sent back to the web browser using same HTTP protocol.
5. The web browser then processes the response and displays the web page (www.yahoo.com home page).
6. User may then fill in some data in the form provided in the web page (Say for login to yahoo, user name and password, or for registration some information ), and sends the request with the data filled using POST method to the web server again using HTTP protocol.
7. Web server will receive the request and process the data and send back the response to the web browser.
8. Web browser will receive the response and will display the web page.
This process is repeated over a web application session. Therefore this concludes that the key players for web application is HTTP Protocol for communication, Web Browser – Software to display web page and web form, and process HTML and Java Script, and Web Server- Server, to process the request of the user sent from web browser.
There are two key players in running the show for the web application are: Web Browser and Web Server.
Web Browser works on user (client ) side and Web Server works on Server Side. The following steps are usually involved in the communication process between browser and web server are as follows:
1. A user initiates a request by typing in a url in address bar of the web browser (say: http://www.yahoo.com).
2. A request is send to the web server using HTTP protocol, and GET method to web server hosting the web application.
3. The Web Server (Yahoo.com web server), processes the request, as this request is for default page (Home Page), retrieves the code for the default page, and run it.
4. After running the code, the output produced is in the form of html and java script, which is sent back to the web browser using same HTTP protocol.
5. The web browser then processes the response and displays the web page (www.yahoo.com home page).
6. User may then fill in some data in the form provided in the web page (Say for login to yahoo, user name and password, or for registration some information ), and sends the request with the data filled using POST method to the web server again using HTTP protocol.
7. Web server will receive the request and process the data and send back the response to the web browser.
8. Web browser will receive the response and will display the web page.
This process is repeated over a web application session. Therefore this concludes that the key players for web application is HTTP Protocol for communication, Web Browser – Software to display web page and web form, and process HTML and Java Script, and Web Server- Server, to process the request of the user sent from web browser.
Subscribe to:
Posts (Atom)