Posts

Source Code Beautifier And Format Source Code For Blogger and Websites

Source Code Beautifier For Blogger and Websites, Format Source Code , Format Source code for blog or blogging & website, Online line source code formatter tool, blogger code format tool, Format source code for blog-spot,Insert formatted source code How to format source code for blogger & website :   You can format your source code for blogger & website in easy three steps.. 1) Paste your source code into "Paste Here Your Source Code" Text-area. 2) Choose appropriate options from "formatting options" and click Format Source Code button.. 3) See preview of formatted source code if it's fine then copy from "Copy Formatted Source Code" text-area otherwise repeat step 2  This source code formatter allow you to format code like JavaScript, HTML, CSS, C#, PHP, ASP.net, VB.Net, Visual Basic, DOT.net, ASP & many other languages.  It does not add unnecessary tags into formatted code, It use only two tag HTML tags &

Dependency injection in ASP.NET Core MVC controller explained step by step

ASP.NET Core MVC controllers should request their dependencies explicitly via their constructors. In some instances, individual controller actions may require a service, and it may not make sense to request at the controller level. In this case, you can also choose to inject a service as a parameter on the action method. With ASP.NET 5 MVC6, we get a feature called dependency injection baked right into the framework for us. Dependency injection is a technique that follows the Dependency Inversion Principle, allowing for applications to be composed of loosely coupled modules. ASP.NET Core has built-in support for dependency injection, which makes applications easier to test and maintain. ASP.NET Core's built-in support for constructor-based dependency injection extends to MVC controllers. By simply adding a service type to your controller as a constructor parameter, ASP.NET Core will attempt to resolve that type using its built in service container. Services are typically, b

Introduction of Asp.net MVC Basics for beginners

MVC is an architectural pattern which separates the representation and user interaction. It's divided into three broader sections, Model View Controller.  Below is how each one of them handles the task. View : The View is responsible for the look and feel. Model: Model represents the real world object and provides data to the View. Controller: The Controller is responsible for taking the end user request and loading the appropriate Model and View. Advantages of ASP.NET MVC Extensive support for TDD. With asp.net MVC, views can also be very easily unit tested. Complex applications can be easily managed Separation of concerns. Different aspects of the application can be divided into Model, View and Controller. ASP.NET MVC views are light weight, as they do not use view-state. It provides extensive support for URL Routing that helps to make friendly URLs (means friendly for human as well as Search Engines). Support for existing ASP.NET features like membership

How to ping Azure VM using C# code explained

I was looking for the code which can ping the Azure VM and give me the details whether VM is UP or down since the ICMP protocol is not permitted through the Azure load balancer, you will notice that you are unable to ping an Azure VM from the internet, and from within the Azure VM, you are unable to ping internet locations. To get rid of the issue i digged the internet to get the solution so finally i got the below solution which I have contructed through the function, below function will ping the azure vm machine and returns true if online or false if offline   public static bool PingServerWithSocket(string iporHostname,int portNo)         {             bool result = false;                             try                 {                     var sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);                     sock.Blocking = true;                                         IPAddress ipaddes = Dns.GetHostEntry(iporHostname).AddressList[0];

Regular expression for validating URL in Javascript

I was looking for a decent regular expression to validate URLs that were entered as user input with. After lots of searching on google i got the perfect solution which satisfy my requirement of my current assignment Following is the regular expression for validating URL (Valid URL Regular Expression) a have used which worked perfectly. ^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$ Following is the pattern results for the same https://www.test.com   -Passed http://www.test.com   -Passed www.test.com   -Passed test.com   -Passed http://blog.test.com    -Passed http://www.test.com/product   -Passed http://www.test.com/products?id=1&page=2   -Passed http://www.test.com#up   -Passed http://255.255.255.255   -Passed 255.255.255.255   -Passed http://invalid.com/perl.cgi?key= | http://web-site.com/cgi-bin/perl.cgi?key1=value1&key2   -Failed http://www.site.com:8008   -Passed Comment if you like it!!