ASP.NET 2 Custom Control for Google "UrchinTracker" as sample

21 בפברואר 2008

Simple example to create ASP.NET 2 Custom Control for Google "UrchinTracker" 1) Edit Web.config file add the next code between <system.web> <pages>     <controls>          <add namespace="Render.Web.UI.CustomControls" assembly="App_Code" tagPrefix="render" />     </controls></pages> 2) Create a new class file *.cs in App_Code/Render/Web/UI/CustomControls using System; using System.Web.UI; using System.Text; using System.Web.UI.WebControls;   /// <summary> /// Summary description for UrchinTracker /// </summary> namespace Render.Web.UI.CustomControls {       // Inherit Control     public class UrchinTracker : Control {           #region Fields         private string userAccount;         #endregion           #region Properties         public string UserAccount {             get { return userAccount; }             set { userAccount = value; }         }         #endregion           #region Constructor         public UrchinTracker() {             //             // TODO: Add constructor logic here             //         }         #endregion           public string GetOutput() {             StringBuilder output = new StringBuilder();            ...
אין תגובות

How to write JavaScript right?

19 בפברואר 2008

Ok guy's.We are having 3 ways (Prototype, Object and Closure) to write JavaScript but I like at once strong and beautiful "Prototype". Here attached example for Prototype way (with Namespaces, Classes and Methods as in C#). // Namespace Corefunction core() { return this.constructor('release 1.2.3'); }core.prototype = {    version:'',    constructor: function(version) { this.version = version },    remote:{        access:{            get:function(url, data, callback) {                // Do            }        }    },    web:{        ui:{            init:function() {},            controls:{                message:{                    show: function(title, context) {                        // Do                     }                }            }        }    },    user:{        info:{            get: function(userName) {                var property = ;                property = this.prototype.remote.access.get('http://',{rq:userName}, function(){ });                return property;            }        },       ...
תגיות:
3 תגובות