Posts

Mathematical Expression Evaluation from string in C# using Stack

Mathematical string expression can be evaluate in c# using build in public static double Evaluate(String input)         {             String expression = "(" + input + ")";             Stack<String> operators = new Stack<String>();             Stack<Double> values = new Stack<Double>();             for (int i = 0; i < expression.Length; i++)             {                 String str = expression.Substring(i, 1);                 String prevStr = string.Empty;                 if (i > 1)                     prevStr = expression.Substring(i - 1, 1);                 if (str.E...

WebGrid In MVC3 using Ajax

Image
In MVC3 Webgrid leverages showing data in grid format.This helper is found in the System.Web.Helpers.dl. If your are using Visual Studio 2010 and MVC3 project then this dll is automatically added you need to refer in your controller . Work Flow:  On page load using AJAX Action method that return webgrid JSON is returned Which is placed inside a div to show grid format data. Here is project structure: Index.aspx This page is loaded first time because of default routing you can find in Global.asax routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults ); Which tell aspxengine that index action in home controller is the default action. <%Html.RenderPartial("WebGridPV"); %> This will load partial view webGridPV , This ...

Deploying MVC3 R2 Applications in Windows Shared Hosting Environment

Image
Most of the windows servers are  installed with MVC3 . When you are going to deploy MVC3 R2 application in shared hosting environment , some features will fails .Recently i faced this and it become a night mire.I am using Godady windows shared hosting account and my application was developed in MVC3 , website was successfully published and running nicely, only issue was with calling Async function using delegates and IPN listener for PayPal. Resolution  Make sure your account uses IIS 7 Change Pipeline Mode on Your Windows IIS 7 Hosting Account . Select Integrated Pipeline Mode.     In Godady : Login  to your hosting account and select on IIS Management -> Click Pipeline ->Select         Integrated Change Pipeline Mode on Your Windows IIS 7 Hosting Account In your Project References section, set Copy Local to True for the following assemblies: Solution explorer and open references  Copy...