@Html.Action vs @Html.RenderAction in Asp.Net MVC

@Html.Action @Html.Action returns string. Syntax : @Html.Action(“Action”,”Controller”). Pass parameter with Action method Syntax : @Html.Action(“Action”,”Controller”, new {ParameterName=ParameterValue}). It is slower as compared to @Html.RenderAction. It’s result can be manipulated before rendering to the output stream. Manipulation : @{ var data= Html.Action(“Action”,”Controller”, new {ParameterName=ParameterValue}); } @data I am Software Developer. Use when data length is small or need to manipulate result Continue Reading…

@Html.Partial vs @Html.RenderPartial in Asp.Net MVC

@Html.Partial @Html.Partial returns string. Syntax : @Html.Partial(“Partial View Name”). Pass model with Partial method Syntax : @Html.Partial(“Partial View Name”, Model). It is slower as compared to @Html.RenderPartial. It’s result can be manipulated before rendering to the output stream. Manipulation : @{ var data= Html.Partial(“Partial View Name”); } @data I am Software Developer. Use when data length is Continue Reading…

Soap vs Rest API

Soap SOAP stands for Simple Object Access Protocol. SOAP is a protocol. SOAP uses HTTP and SMTP transport protocol. SOAP supports only XML format. Using HTTP, SOAP model can tunnel to across firewalls and proxies without any modification to the SOAP protocol. SOAP is more secure as compare to REST because it uses own security Continue Reading…

Call action from button click event in Asp.Net MVC

We can call action from button click event using location.href.

How to host a window service using installUtil.exe.

Steps to host window service using installUtil.exe Go to installUtil.exe path C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe Build Application in Release mode. Open VS2012 x86/64 Native Tool Command with Run as Administrator cd (Copy+Paste InstallUtil.exe path) Enter Application Path Enter

Grouping data in autocomplete textbox using jquery in Asp.net MVC.

We can group data in autosuggest textbox in Asp.net MVC using jquery. Add a input box in your View. Add model in your view. Creation of model will be done later. Add style sheets in your view. we are referring some css and js files from jquery cdn. Download this style sheet and add to your Continue Reading…

Get address from latitude and longitude using Bing map api

We can find address components Country, AddressLine, Postal code etc. from latitude and longitude using Bing map api. For this Microsoft provide a Bing map rest api service. Call this service using HttpClient and get response in json format. To use Bing map rest api service BingMapKey required. Create Bing map key from the portal Continue Reading…

Get address from latitude and longitude using google map api

We can find address components Country, State, Postal code etc. from latitude and longitude using google map api. For this google provide a service. We have to call this service using post method. Service return result in two formats xml or json based on the parameter passed as xml or json. Call the service by Continue Reading…

Jquery cross domain ajax request

Jquery cross domain ajax request can be made by setting crossDomain property to true. For cross domain request we need to set some configurations in both the application’s web.config file. For cross domain ajax request we need to set max Json Length in both the application’s web.config file. Put the below lines inside the Configuration Continue Reading…

How to fetch html from a URL in c#.

Fetching a html from an URL is easy. Class System.Net.HttpWebRequest provides an HTTP – specific implementation of the System.Net.WebRequest class.