DIV, P and SPAN tags.

By default, <p> </p> will add line breaks before and after the enclosed text (so it creates a paragraph). <span> does not do this, that is why it is called inline. When we are using normal text at that time we want <p> tag.

When we are using normal text with some effects at that time we want <span> tag. An important difference is that <div >, <p> are block elements and  <span> is inline, meaning that <p>Hi</p><p>There</p> would appear on different lines when <span>Hi</span><span>There</span>winds up side by side. Continue reading

By Sriramjithendra Posted in HTML5 Tagged

How to use AngularJS in ASP.NET MVC and Entity Framework

This post is taken from Dhananjay Kumar.

In short, this post will touch upon:

  • adding an AngularJS library in ASP.NET MVC;
  • reference of AngularJS, bundling and minification;
  • fetching data using the Entity Framework database;
  • returning JSON data from an ASP.NET controller;
  • consuming JSON data in an AngularJS service;
  • using AngularJS service in AngularJS controller to pass data to the view; and
  • rendering data on an AngularJS View

Continue reading

Client Browser’s Submit Mechanism And The Postback Mechanism in ASP.NET and How the server knows which button clicked

While reading about “UseSubmitBehavior in an asp.net button”, I came to know that UseSubmitBehavior property to specify whether a Button control uses the client browser’s submit mechanism or the ASP.NET postback mechanism. By default the value of this property is true, causing the Button control to use the browser’s submit mechanism. If you specify false, the ASP.NET page framework adds client-side script to the page to post the form to the server. (causes the button to use the ASP.NET postback mechanism, also to identify at server side which button was clicked in the browser.). Continue reading

Numbers as keys in JSON object

JSON object: 
var jsonParams = {
                Name: ‘ram’,
                    1: ‘asdf’,
                     2: ‘2312’
If you want to read value from above JSON object
$(“#Street”). val(jsonParams[“1”]);