Posts

Showing posts with the label .NET

Reading NS records in C# using ARSoft packages

In this post you will learn about reading NS records in C# using ARSoft packages. This package is handy to read domain NS records. Here's a sample code which will help: using System; using System.Linq; using ARSoft.Tools.Net; using ARSoft.Tools.Net.Dns; namespace ConsoleApp14 {     class Program     {         static void Main(string[] args)         {             var dnsMessage = DnsClient.Default.Resolve(DomainName.Parse("learninhindi.com"), RecordType.Ns);             var nsrecords = dnsMessage.AnswerRecords.OfType<NsRecord>();             foreach (var record in nsrecords)             {                 Console.WriteLine(record.NameServer.ToString().TrimEnd('.'));             }             Console.ReadKey();         }     } } Here's the output of the above code: amit.ns.cloudflare.com fiona.ns.cloudflare.com Hope this helps.

Attended Microsoft MVPs Open Day 2015 in Bangalore

Image
It was another year I attended Microsoft MVPs Open Day event in Bangalore, last time it was in Goa. ||For those who don’t know what MVPs Open Day is Every year Microsoft MVP Award Program organizes an event dedicated for MVPs only. In such event MVPs gathered together from different cities (South Asia MVP region includes India, Nepal, Bangladesh etc countries). Such events feature technical sessions designed to enhance the community's understanding of new Microsoft products, existing tools and new techniques. But MVPs like me don't come to learn just from Microsoft teams, we present during Open Days, which allows MVPs to    i) share real-world knowledge of Microsoft technologies aka "MVP to MVP" sessions    ii) network with fellow MVPs in person and this helps understand community more closely    iii) enjoy with fellow MVPs I had a great time with MVPs and Lead. I would like to thank Biplab and Gandharv for organizing this event  beautifull

I Am Now The Published Author of Instant Razor View Engine How-To

Image
I am happy to announce the release of my book ‘ Instant Razor View Engine How-To ’, published by PACKT; and now available at Amazon for purchase. Click on the image to enlarge. Amazon: http://www.amazon.com/dp/1849696306/?tag=packtpubli-20 Packt Publication: http://www.packtpub.com/razor-view-engine/book Like us on Facebook here: https://www.facebook.com/RazorViewEngine

Modernizr Library in MVC 4

Image
In this post you will learn how developers take the advantage of  Modernizr   in MVC 4 Applications.

Adding Email, Details field in UserProfile DB Table in MVC

Image
In this post you will learn how to add Email and Details columns to an existing database. We get this database when running an application trying to create a new user account. As you know, we don’t see an email field in a user registration form as well as in the membership database. But we can enable this using some quick changes in the application. Read on.

Example on View to Controller (HttpPost) & warn on duplicate entry & delete duplicates in MVC

Image
This is a quick response post to the blog reader ‘V Patel’ who asked this question yesterday. Here is the question:

JQuery UI Datepicker in MVC 4

Image
Today, I spent couple of hours in finding solution to enable the use of Datepicker in MVC 4 Application.

Filter Records in MVC

Image
In this quick post you will learn various ways to filter records in MVC. Before starting let’s have a quick look at a controller and view page that I will use in this article. I will be using the SQL Server Northwind sample database in this article, you can download it from the Microsoft website and set up the same project to explore it.

Partial View in Razor MVC

Image
Partial View allow us to put HTML and C# code into a file that we can reuse across multiple other views. This is very useful when you work on a large application.

Html Helper for Image (@Html.Image): Developing Extension in MVC

Image
Today I worked on a project where I required to display image on the web page. As you know there is not a Html Helper for Images yet. Look at the screen, we can’t see an image here.

HandleErrorAttribute OR Error Handling in MVC 4

Image
HandleErrorAttribute in MVC is used to display friendly error pages to user when something goes wrong in the application. Let’s create a simple exception in the application to explore HandleErrorAttribute.

What happens when database doesn't match conventions / using OnModelCreating() feature?

Image
This is just basic article and I’m not going to say anything new here but I will say things in my way.  The very well-known question newbies ask about MVC and Entity Framework is, how does a conceptual database model target the names?

MVC Bind Attribute like [Bind(Exclude = "Name")] or [Bind(Include = "Address, Payment, EmailID")]

Image
When we have an ASP.NET MVC View that accepts user input and posts those inputs to a server we have the option to use the built-in Model-binding features to provide more control and security, we can restrict the properties that are allowed to be bound automatically.

The name 'Scripts' does not exist in the current context

Image
There is a very small bug in the MVC 4 Empty Template that can be seen when you create a new MVC 4 Application with an "Empty" template and start adding views for CRUD operations (using scaffolding). And when you run the application and try to navigate (to  http://localhost:port/controller/Create  or  http://localhost:port/controller/Edit ) in "Edit.cshtml" and "Create.cshtml" views, you get the following error:

Creating ASP.NET WebApplication/ASP.NET MVC Application Membership Database on SQL Server rather than LocalDb

Image
I was asked this question from one of my blog reader: How can a DB be created in SQL Server rather than locally (LocalDb) which is default?

Using image with HtmlHelpers or @Html.ActionLink

Image
Sometimes we need to serve image with the link and with the release of Razor syntaxes we have HtmlHelpers like Html.ActionLink() that has nothing like image.

Unable to retrieve metadata for 'MusicStore.Models.Album'. Using the same DbCompiledModel to create context against different types of database servers is not supported. Instead, create a separate DbCompiledModel for each type of server being used.

You will get this error in the step by step tutorial (on page here ) provided by Microsoft that starts from here .

Entity Framework Console Applications with SQL Server Compact

Image
Microsoft SQL Server Compact Edition is an embedded database system that allows us to integrate it in our Web, Desktop and Mobile applications.

Entity Framework's Database Seed Method

Image
The Entity Framework can automatically create/update/drop databases when the application runs. We can specify that, this should be done every time application runs or only when the model is out of sync with the existing database or in other word it runs whenever model changes. You spent time to insert records in database and when you made any changes in model, Entity Framework deletes your database as well as records.

Mapping Table-Valued Functions (TVFs) using Entity Framework Database First

Image
Entity Framework 5 brings number of improvements and Mapping Table-Valued Functions (TVFs) Support is one of them.

Popular posts from this blog

Migrating database from ASP.NET Identity to ASP.NET Core Identity

Customize User's Profile in ASP.NET Identity System