The Razor is the new View engine introduced in MVC 3.0. The View engine is responsible for processing the view files [e.g. .aspx, .cshtml] in order to generate HTML response. The previous versions of MVC were dependent on ASPX view engine. The syntax for server side code is simplified The length of code is drastically reduced Razor syntax is easy to learn… Read more →
REST and Soap
REST stands for Representational State Transfer. This is a protocol for exchanging data over a distributed environment. The main idea behind REST is that we should treat our distributed services as a resource and we should be able to use simple HTTP protocols to perform various operations on that resource. When we talk about the Database as a resource we… Read more →
Get Words from NUMBER
— select dbo.fnNumberToWords(2323422435); Alter FUNCTION fnNumberToWords(@Number as BIGINT) RETURNS VARCHAR(1024) AS BEGIN DECLARE @Below20 TABLE (ID int identity(0,1), Word varchar(32)) DECLARE @Below100 TABLE (ID int identity(2,1), Word varchar(32)) INSERT @Below20 (Word) VALUES ( ‘Zero’), (‘One’),( ‘Two’ ), ( ‘Three’), ( ‘Four’ ), ( ‘Five’ ), ( ‘Six’ ), ( ‘Seven’ ), ( ‘Eight’), ( ‘Nine’), ( ‘Ten’), ( ‘Eleven’… Read more →
REST Service
REST stands for Representational State Transfer. This is a protocol for exchanging data over a distributed environment. The main idea behind REST is that we should treat our distributed services as a resource and we should be able to use simple HTTP protocols to perform various operations on that resource. When we talk about the Database as a resource we… Read more →
How to choose from Viewstate, SessionState, Cookies and Cache
Web applications are stateless, means once a web page is rendered from server to client, nothing in the page remains on server and the next time user submits the page, the page will be called and created from scratch. ASP.NET provides following solutions to solve this problem: 1- Viewstate 2- Session Variables 3- Application Variables 4- Cache 5- Cookies Now… Read more →
Cookieless Session ASP.NET
Cookie–>Cookies are usually small text files, given ID tags that are stored on user computer’s browser directory or program data subfolders. Cookies are created when use your browser to visit a website that uses cookies to keep track of movements within the site. The website stores a corresponding file(with same ID tag)to the one they set in browser and in… Read more →
Recursive Queries Using Common Table Expressions
A common table expression (CTE) provides the significant advantage of being able to reference itself, thereby creating a recursive CTE. A recursive CTE is one in which an initial CTE is repeatedly executed to return subsets of data until the complete result set is obtained. A query is referred to as a recursive query when it references a recursive CTE.… Read more →
How to call Usercontrol in Asp.Net or Js file
Ascx Page(User control page)—– <%@ Control Language=”C#” AutoEventWireup=”true” CodeBehind=”WebUserControl1.ascx.cs” Inherits=”WebApplication2.UControls.WebUserControl1″ %> <asp:TextBox ID=”txt1″ runat=”server”></asp:TextBox> Asp.net Page— <%@ Page Language=”C#” MasterPageFile=”~/Site.master” CodeBehind=”Default.aspx.cs” Inherits=”WebApplication2._Default” %> <%@ Register Src=”~/UControls/UserControlMultipleInstance.ascx” TagName=”UserControlMultipleInstance” TagPrefix=”uc1″%> <%@ Register Src=”~/UControls/WebUserControl1.ascx” TagName=”uio” TagPrefix=”kl” %> <asp:Content ID=”headContent” ContentPlaceHolderID=”head” Runat=”Server”> </asp:Content> <asp:Content ID=”Content1″ ContentPlaceHolderID=”ContentPlaceHolder1″ Runat=”Server”> <script type=”text/javascript” src=”~/Scripts/JavaScript1.js”></script> <asp:ScriptManagerProxy ID=”ScriptManagerProxy1″ runat=”server” /> <h2>My tables</h2> <div id=”div1″> <kl:uio ID=”UserControlMultipleInstance1″ runat=”server” /> </div> <br… Read more →
Change WAMP server Port Set MySql Password
Set port after wampmanager.tpl http://localhost:portnumber like Type: item; Caption: “${w_localhost}”; Action: run; FileName: “${c_navigator}”; Parameters: “http://localhost:90/”; Glyph: 5 Change port number in C:wampbinapacheapache2.4.9confhttpd.conf Change Password phpmyadmin C:wampappsphpmyadmin4.1.14config.inc.php Change Local to lan or wan network Change httpd.conf file line no 280 #Require local to Require all granted <Directory “c:/wamp/www/”> # onlineoffline tag – don’t remove #Require local Require all granted </Directory> Read more →
ScriptManager Role in Ajax
The controls that UpdatePanel and ScriptManager are used for the ASP.NET AJAX Enabled sites. We use them; firstly, because in traditional webpages the entire page is loaded after a postback, the HTML sent to the browser is much larger than it needs to be. Second, because the entire page is replaced, the browser has to dismiss the old one and… Read more →