Posts

MVC application for Starters .

MVC is the framwork for creating Webapplication , in this we have bifercated the different components of the webapplicationas into different categories . M stands for model , which menas the datalayer in the form of a model . V stands for view this is the the html pages which is manupulated using the model and the controller. C which means controller, the controller is the class having multiple methods these methods are used to call the views . Basically the Controller is just a method function of the class inside the controller.MVC dll that is System.Web.MVC which contains the details that how the calling process can be carried by the action method. View are genrated using the Razor Engine which works when a view is called by the user. Razor engine Renders the whole html page and sends It as the response . Lets have a small example of creating MVC application . * Open visual studio. * Click File option. * Click new option. * Click the project option to start creati...

Functions in VB.Net ?

In Vb.net we use procedure in place of function. Procedure is a group of statements which combined together perform a task. VB.net has two types of procedure Functions   Sub Procedure or Subs Funcion returns a value where as sub are non- return type procedure. Function  Example Function FindMax(ByVal num1 As Integer, ByVal num2 As Integer) As Integer    ' local variable declaration */    Dim result As Integer    If (num1 > num2) Then        result = num1    Else        result = num2    End If    FindMax = result End Function Sub Procedure Or Sub's Example    Sub CalculatePay(ByVal hours As Double, ByVal wage As Decimal)       'local variable declaration       Dim pay As Double       pay = hours * wage       Console.WriteLine("Total Pay: {0:C}", pay)    End S...

How to pass model in a ajax call to a method ??

Form MVC 3 or MVC 2 the objs passed in the form of json are automatically converted model format if the model of that type of object exists. Example Let say we have a model 'Customer' Public class Customer { public int CustomerID {get; set;} public string CustomerName {get; set;} public string CustomerAddress {get; set;} } Here we have a model 'Customer' with 3 attributes ID, Name, Address. Now we need to have a Get method and a post method public ActionResult Index() { return View(""); } [HttpPost] public ActionResult Index( Customer modelCustomer) { // Do your stuff here return View ("") } Here i have two different Function in the above code one is the httpGet method this is used to call the view where as the other is used to call the post method form the view may be using Submit or using ajax calls. here goes the code for ajax call @model iEnumerable @using (Html.BeginForm("Index", "Home" , FormMethod.Post , ...

Passing multiple models in single view .

There are two different ways of doing this . * Passing parent view that contains both the models which we want to pass in the view . * passing each model in a ViewBag we have two different models public class Customer { public int CustomerID {get; set;} public string CustomerName {get; set;} } public class Product { public int ProductId {get; set ;} public string ProductName{get; set ;} } 1. By passing a parent view Here we want to pass both the models in a single view , by default the razor engine only accepts single model per view. so we need to create a parent view that hold both the models. public class ParentView { public Customer customer{get; set;} public Product product{get ; set;} } then we can call the model in the view by using the following code in view page : @model iEmumerable <models.ParentView> ForEach(var v in ParentView) { < option > @v.customer.CustomerID < / option > < option > @v.customer.CustomerName <...

A Briefing to MVC

Image
MVC  Its is a framework for better web application development . Before this used the Web Forms for the purpose of web application creation. Web application creates has a long runny heavy process in which the controller is connected and maintained by server. The details of every small control is connected and shared with server at every point. Thus MVC was introduced to get the a light weight web application. its uses the HTML controls to make the page . In web forms the controls are converted to the Html tags at run time but in MVC the the Html is created at the design time thus making it faster than any other web forms based application .  MVC has some positive points over the Web Forms   It provides better structure to web applications As controller created in MVC are class of  .Net thus its is easy to create unit cases and the automatic manual test cases. it can provide a better layored architecture to the user to work parallel on same application...

Issue happened with MOSS 2007

Problem We have SharePoint server 2007 connected to the production environment with the SQL Data base name WSS_Content_P. Due to some technical changes we by mistake triggered the Production Front end to the Test environment Database that is WSS_Content_T . Here the Test database was just the replica of the production database with difference of 2 days. Now after some days we got to know that such a problem has been created. We found that business data of 2 days was missing from the database. Solution : In the End we came to solution to any how sync the two databases. Now we needed the best database comparison tool to check the data from the two database server. Tool Used :  VISUAL STUDIO Internal Tool : SQL > DATA COMPARE ·          Click the Data compare option in visual studio. ·          Provide the connection to both the databases, one will be source and other will be the destination. · ...

Working on Web application? Remember these Points for the UI prespective !!

We use multiple languages to create a web application but the browser is only able to understand HTML ,JS ,CSS etc.  Remember some points to create a better web application . 1. Mobile First Application - In  today's mobile world most of the people use mobile devices to access different websites. You first need to know your customer if you wish to go mobile try to keep in mind the concept of mobile first . Use responsive templates or themes to create applications. Generally before this developer use to check which device is accessing the website based on which they for the . Many of you have generally seen that when access many of the websites they shows m.website this ' m ' shows that the programmer has checked for the device and then routed you to different pages that is specific for mobile device. But in many cases i have seen the developers forget to check for the opposite . so the better idea is to use a responsive template which automatically changes the...