Month: July 2014

Mvc Scenario based discussion

MVC– 1)definition: it is framework that splits an application’s implementation logic into three component roles: –Model->work as business logic and storage mechanism to store the data. Entity framework work in this component. view ->it is user interface logic to which user direct interact in this component. Asp. Net and Razor use in view component. controller->it is handle the request from… Read more →

Latest updated questions

1.caching maintain through if each server has different load. 2.try catch recursive means multiple try-catch in catch statement. 3.overload in properties and operator overloading 4.dropdown bind through list 5.mutuable and immutable difference. 6.role of beginrequest. 7.discuss abouthttpcontext,httpmodule,httphandler . 8.what is wrapper class. 9.role of sealed,abstract and static. 10.difference between .equals,hashcode and == 11.int x=5?”ram”:”null”……….is it same work as if-else statement.… Read more →

how to pass value from view to controller

ASP.Net MVC How to pass data from view to controller >>To viewModels that passed data from controller to view.   public class ReportViewModel { public sring Name {get;set;} } and in your Get Action, public actionresult report(){ return view(new reportviewmodel()); } and view must be strongly typed to reportviewmodel @model ReportViewModel @using(Html.BeginForm()) { Name:@Html.TextBoxFor(s=>s.name) <input type=”submit” value=”Generate report” /> }… Read more →

Enum and Enumerable data

An enum is a custom data type of Name/Value pair.An enumeration is a class or structure that implements .net interface named Ienumerable. Typically, this interface is implemented on collection classes, as well as the System.Array class // Compile-time error! 999 is too big for a byte! enum EmpType : byte { Manager = 10, Grunt = 1, Contractor = 100,… Read more →

Difference between linq and lambda expression

LINQ is a querying technology (Language Integrated Query). LINQ makes extensive use of lambda’s as arguments to standard query operator methods such as the Where clause. A lambda expression is an anonymous function that contain expressions and statements. It is completely separate and distinct from LINQ. Read more →

Invoking Methods Using Named Parameters in C#

Invoking Methods Using Named Parameters Another language feature found in C# is support for named arguments. To be honest, at first glance, this language construct might appear to do little more than result in confusing code. And to continue being completely honest, this could be the case! Similar to optional arguments, including support for named parameters is largely motivated by the desire to… Read more →

Distinction between output and reference parameter

>>output parameter do not need to initialize before the passed to the method.it must assign when before  exiting the method calling. >>reference parameter must assign the before passed to the method. The reason is that passing the reference to an existing variable. If not assign works as unassigned variable. // Returning multiple output parameters. static void FillTheseValues(out int a, out string… Read more →

Access Modifiers in C#

Access Modifiers in C# Modifiers 2003 2005 2008 2010 2012 2013 abstract yes yes yes yes yes yes async – – – – yes yes const yes yes yes yes yes yes event yes yes yes yes yes yes extern yes yes yes yes yes yes in – – – yes yes yes out – – – yes yes yes… Read more →

volatile in .net vb and C#

http://msdn.microsoft.com/en-us/library/x13ttww7.aspx The volatile modifier is usually used for a field that is accessed by multiple threads without using the lock statement to serialize access. The volatile keyword can be applied to fields of these types: Reference types. Pointer types (in an unsafe context). Note that although the pointer itself can be volatile, the object that it points to cannot. In other words, you cannot declare a… Read more →

Site Maintenance Mode

Create A fie “app_offline.htm” in the root of the site, where hosted. “app_offline.htm” file size should be larger than 512. It is use as default page of site. It allows you to modify/remove the locks from those files and replace them, without the need to do a full IISRESET, When we publish site through Visual Studio, it use [Users][LoginUser]AppDataRoamingMicrosoftVisualStudio12.0app_offline.htm. Error : 503… Read more →