Posts

AngularJs - Simple Example

In Angular "-" is used because HTML specification says that anything with - will not be parsed by HTML. Means If you will use - in element naming then other needs to parse it. So in thins case Angular will parse elements. $scope - Is a Angular Service for a scope management. As per the following code, Each ng-controller scope is different. $scope is parameter for your function and angular will inject $scope object into your function. $rootScope - Application have only one rootScope and which is global. This code will create object of customer class  and this controller will have his scope under that scope he do have access to Customer Name and Customer Code.  <div  ng-controller ="customerObj">  $scope.$watch ("CustomerAmount", function() - This is the customer watch code ng-App - In one HTML file you can have only one ng-app. ::  is considered a one-time expression. One-time expressions will stop recalculating once they are stable, ...

Dependency Injection

Image
Replace dependencies with Dependency Injection to make your classes easier to reuse and test. The dependency injection pattern, is one of the most popular design paradigms today. It facilitates the design and implementation of loosely coupled , reusable , and testable objects in your software designs by removing dependencies that often inhibit reuse. Dependency injection can help you design your applications so that the architecture links the components rather than the components linking themselves. Samples used for this presentation:  DI_Demo.zip

WCF Bindings - Overview

Image

Calling a Static Page Method using jQuery

If you do not plan to call a web method from multiple pages, don’t perform all the work of creating a separate web service. Instead, you can expose a static method from the same AJAX page calling the web method. 1..ASPX Page - DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> < html xmlns ="http://www.w3.org/1999/xhtml"> < head id ="Head1" runat ="server">     < title > Show Web Service Method title >     < script type ="text/javascript" src ="../Scripts/jquery-1.4.1.js"> script >     < script type ="text/javascript">         $(document).ready( function () {             $( "#btnGet" ).click( function () {                 $.ajax({ ...

Calling Web Services from the Client using jQuery

1. .ASMX page - Web Service Code: [ WebService (Namespace = http://tempuri.org/ )] [ WebServiceBinding (ConformsTo = WsiProfiles .BasicProfile1_1)] [System.ComponentModel. ToolboxItem ( false )] // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. [System.Web.Script.Services. ScriptService ] public class QuotationService : System.Web.Services. WebService     {         [ WebMethod ]         public string GetQuote()         {             List < string > quotes = new List < string >();             quotes.Add( "The fool who is silent passes for wise." );             quotes.Add( "The early bird catches the worm." );...

What Is jQuery?

jQuery is an extremely fast, lightweight JavaScript library that simplifies many aspects of client-side web development.You can use jQuery for almost any client-side functionality that you can think of—event handling,animations, drag-and-drop functionality, asynchronousweb service calls, and much more. Furthermore, jQuery supports a robust plug-in modelthat enables developers to write their own extensions to implement whatever functionality they want. There are already hundreds of powerful jQuery plug-ins available. jQuery is CSS3-compliant and works on almost all browsers—Internet Explorer 6.0+, FireFox 2+, Safari 3.0+, Opera 9.0, and Google Chrome. This means that you can write one set of code and not have to worry about handling the specifics of different browser implementations; each line of jQuery works exactly the same on all browsers.The jQuery library is used on an incredible number of popular websites. Google, Dell, Bank of America, Digg.com, Netflix, WordPress, and even th...

WCF (Windows Communication Foundation)

What is WCF? WCF is service oriented technology. Using WCF framework, we can build the service oriented architecture. WCF is unification of .NET framework communication technologies like MSMQ, Remoting, Web Services and COM+.

Fiserv Interview Questions.

1) For edit functionality in DataGird specify Column name 2) Why you may not want to use Paging funtionality in data grid 3) Function of SqlCommanBuilder in code. 4) Find the error in code . Its related to database connection. I think that connection sould be closed in finally instead of try. 5) What is the relation between src='' & Inherits='' in <@ Page > directive 6) What is derective in the user control page & its extention of file 7) Question related to 404 error code Error page & Default error page. 8) Its related to Autherization in web config related to folders 9) Related to definition 10) not remembred with question but answer is cookiless = true related question 11) Page is posting the 2 times why is it so 1) user control load 2) some control call load 12) describe !Page.PostBack Select Options 13) Question related to Session mode = SQLServer 14) Some question related to validation control - compare validator 15) Some question ...

Send Email in asp.net

add System.Net.Mail; namespace ///*********************************************************************************     ///     ///To Send the simple  Email     ///     /// From Email Id     /// To Email Id     /// Email Subject     /// Email Body     /// Returns bool with Indication     ///*********************************************************************************     public bool SendEMail(string FromAddressId, string ToAddressId,                           string Subject, string MessageBody)     {         SmtpClient objSmtpClient = new SmtpClient();         MailMessage message = new MailMessage();  ...

Creating Error log

using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.SqlClient; using CommonComponents; using System.IO; /// /// Summary description for clsErrorLog /// public class clsErrorLog {     /*************************************************************     NAME:          WriteToErrorLog     PURPOSE:       Open or create an error log and submit error message     PARAMETERS:    ex - object of Exception class                    ErrorTitle - title of the error              ...

Finding Nth Highest Salary Query

SELECT max(sal) FROM  tbltemp WHERE sal NOT IN (SELECT distinct top 2 sal FROM tbltemp ORDER BY sal desc) for eg. for 3rd highest top will be 3-1 =2  (top 2) therefore top N-1 Or SELECT TOP 1 sal  FROM (                SELECT DISTINCT TOP 2 sal                FROM tbltemp               ORDER BY sal DESC               ) A ORDER BY sal

Adding Custom Tags in Web.config

Image
To add cutom tag in your web config its a simple process. I will expain it step by step Add  Following to your web config Remember you have to add information about your System assembly which you can find in your GAC (Global assembly cache) Path: " C:\WINDOWS\assembly " right click on System assembly and you will get Property about it. Then to get those custom tag values  write the following code on default.aspx.cs file  protected void Page_Load(object sender, EventArgs e) {       NameValueCollection Col = new NameValueCollection(); Col = (NameValueCollection)System.Configuration.ConfigurationManager.GetSection("MyCustomSection");         for (int i = 0; i < c1.Keys.Count; i++)         {            Response.Write(String.Format("Key = {0}, Value = {1} ", c1.Keys[i], c1[i].ToString()));   ...

Singleton Design Pattern

one of the good explanation found in ASP.NET 3.5 Application Architecture Design public sealed class EmailManager { private static EmailManager _manager; //Private constructor so that objects cannot be created private EmailManager() { } public static EmailManager GetInstance() { // Use 'Lazy initialization' if (_manager == null) { //ensure thread safety using locks lock(typeof(EmailManager) { _manager = new EmailManager(); } } return _manager; } } let us understand the code step-by-step: 1. public sealed class EmailManager: We have used the sealed keyword to make our EmailManager class uninheritable. This is not necessary, but there is no use having derived classes as there can be only one instance of this class in memory. Having derived class objects will let us create two or more instances which will be against the singleton's design objective. 2. private static EmailManager _manager: Next, we...