Pages

Enterprise Libaray Overview

Microsoft Enterprise Libaray
  • It is collection of reusable sotware component(appln block) design to assist the software developer with common enterprising Development cross-cutting concern
  • Logging,validation,Data Access,exception Handling and so on
  • Application block are type of guidance;they provideed as source code ,test case,documentation tha can be used "as is,"extend ,or extended,or modified by the developer to use on complex enterprise level line of bussiness development projects
  • Enterprise libaray is used when buliding Application that are typically developed widely and interoperate with other application and system
  • Goals of Enterprise library
  • Consistency:All Enterprise library application block features cosistent design pattern and implementation approaches
  • Extensibility:All application block include define extensibility points that allow developer of the application block by adding theri own code
  • Ease of Use:Enterprise library offer numerous usability improvements,including graphical configuration tool,simpler installation procedures,clearer and more complete documentation and sample
  • Integration:Enterprise libaray application blocks are designed to work well together or individually
  • Reference:MSDN

Features of Asp.net 3.5

  • Asp.net Ajax is integerated in to dot netframwork
  • Asp.net Ajax control extender can be added to toolbox vs2008
  • Listview and datapager are new controls are added
  • New Data source control is added called as Linq DataSource
  • LINQ(language Integrated query) add native date query capapbilty to c#.net
  • WCF Support for RSS, JSON, POX and Partial Trust
  • Asp.net 3.5 include a new mergertool(aspnet_merge.exe).it comination and manage assemblies created by aspnet_compiler.exe(In older version it is avilable as addon)
  • new Assemblies 3.5
    1. System.core.dll-Includes the implementation for LINQ to objects
    2. System.data.linq.dll-Include the implementaion for LINQ to SQL
    3. System.Xml.Linq.dll-Include the implementation for LINQ to XMl
    4. System.Date.DatsetExtension.dll-Includes implementation for LINQ to DataSet
  • Asp.net 3.5 provide bettter support iis7 , iis7 Asp.net 3.5 modules and handles support unified configuration
  • vs2002 worked with asp.net 1.0,vs2003 worked with Asp.net 1.1 and vs2005 worked with Asp.net 2.0 and Vs2008 support multiTargetting i.e it works with Asp.net 2.0 and Asp.net 3.5

Framework

  • A set cooperating classes that make reusable Desingn to specfic application
  • A skeleton of an application in which developer plug in ther code and provides most of the commaon functionality
  • A framework is set of common and preferabicated software building block that programmer can be used extends or customise specfic computing solution
  • FrameWork is a skeleton of code for developing a particular type of an application.For example house it is treated as Framework it has predefine components like kitchen ,bedroom etc,futher it is used to build any type of house
  • Dot net Framework
    1. Framework class libaray (FCL):A series of classes with method that encapsulate common system or appication related functionality contained hundered classes avilable to application written to utilize .net language (c#.net...)
    2. .net Runtime Host:it is "sandbox" or "protective bubble" where your application run.manage permission granted to application run .provide a common system of data types accross all .net languages and manages memory for application
    3. Utilies(compiler,code genertor, etc) variours and sundary application that perform a wide variety of task.
  • Note:Design pattern refers to repeatable solution to particular for common occuring software problem.it is solution to particular problem.RelationShip between framework and desiogn pattern is the framwork is made by using one or more design pattern

HTML 5.0 SUPPORTED AND UNSUPPORTED TAGS

  • New Html 5.0 tags
  • <article>-Define an article
  • <aside>-Define content aside from page contents
  • <audio>-Define Sound Content
  • <command>-Define command button,like radio button,a checkbox,a button
  • <datagrid>-Define a data in tree list
  • <datalist>-Define a Dropdownlist
  • <datatemplate>-Define a data template
  • <dialog>-Define a dialog(conversion)
  • <embed>-Define a external interactive contents or plugin
  • <eventsource>-Define a target for event sent by server
  • <figure>-Define a group of media content, and their caption
  • <footer>-Define a footer for a section or page
  • <Header>-Define a header for a section of page
  • <section>-Define a section
  • <source>-Define a media source
  • <time>-Define a date/time
  • <video>-Define video
  • Unsupported tag of Html 5.0 <acronym>,<applet>,<basefont><big> ,<center>,<dir>,<frame>,<frameset> ,<isindex>,<noframes>,<s>,<strike> ,<tt>,<u>,<xmp>
  • Referefnce:W3schools

Ado.net Entity Framwork

  • It is a object-relational mapping(ORM) framework for .Net Framwork
  • It genarate one to one mapping between the database schema(physical schema) and the conceptual schema(logical schema)
  • The Mapping betweeen logical schema and physical schema represent by ENTITY DATA MODEL(EDM)
  • EDM specifies conceptual model of data by ENTITY-RELATIONSHIP DATA MODEL(ERDM)
  • ERDM deals with Entities & Relationship
  • Entity are instance of Entity Type (eg.Customer table,employee table). it consist of rich set of records with a key.Entity are grouped in Entity Set
  • Relationship are associates Entities,and are instance relationship type.Relation are Relation ship set
  • Other concept related to EDM are inheritance , complex types
  • Inhertiance:Entity types can defined so they inherit form other type.Inhertance is a strictly strucutal meaning not as behaviour inheritance as object oriented programing
  • Complex type:EDM support addtional to scalar data type .it support complex type
  • Basic Concept of EDM
    1. Entity Types:An Entity type defines princpal Data objects about which information has to managed such as a person ,Place,Thing,Activities relevant to the application
    2. Property:Entity Type can have one or more properties
    3. Property types
      • Simple Type:It Corresponds to simple Data type(int,char,floating point)
      • Complex Type:It is an aggregate of multiple properties of type simple type,complex type,row type
      • Row Type:It is similar to complex type,except they can not inherted
  • Entity Key:All instantce of entitytype are unique identified by the value of its identity properties.This set entity properties is called an ENTITY KEY
  • RelationShip Type:while Entities types are noun pf a data model,Relationship type are verb that conects those nouns.
  • RelationshipType support by EDM 1)Association 2)Contianment
    1. Association:it is peer to peer relation ship
    2. Containment:It is parent child relationship with spefice member semantices
  • Schema:All EDM types contained with some namespace.The schema concepts defines a namspace that describes the scopes of EDM types
  • Entity Container:EntitysET & Relationship set are defined in the scope of Entity Container.it can reger one or more schema
  • Ado.net Entity framework uses as an xml based defination language called schema defination language(SDL)
Refered Links: MSDN en.wikipedia.org

How to call single click_ event for all buttons on a page

  • First Drag a button on a .aspx page and double click on the button then click event in generated in .cs page
  • Copy eventname (MyButton_click)
  • Drag another button on to a page goto properties windows for the button.
  • click on event list of the properties window go to click event property paste eventname (MyButton_click)
  • In this we can call the same event of for all buttons
  • You can do same for other Controls

Dynamically moving a Panel Control in Asp.net

1)Create a Panel control,placed required control on a panel in a page 2)To move a panel to Left Pseudo code
Units left = new Units(Panel.Style[left]); left= new Units((double)left.value+10,left.Type); Panel.Style["left"]= left.ToString();
3)To move a panel to Right Pseduo Code
Units left = new Units(Panel.Style[left]); left= new Units((double)left.value-10,left.Type); Panel.Style["left"]= left.ToString();
4)Call this code in any of events as required 5)Panel common use properties I)Default Button II)Direction III)GroupingText IV)BackImage Url

Validation of CheckboxList Items

  • Here validating a checkboxlist item.(Atleast one checkbox should be selected)
  • call JavscriptFunctionCode on any javascript Events or from codebehind as required

Javasript Function Code

function validateChklist() { var list = document.getElementById('<%=CheckBoxList1.ClientID%>'); var child =""; for(i = 0; i < list.childNodes.length; i++) { //checkbox list id is 'CheckBoxList1' replace according id of checkboxlist child =document.getElementById('CheckBoxList1$'+ i) if(child.checked) { alert('Thanks for Selecting'); return true; } alert('Please Select atleast one item check box list'); return false; } }

Authetication for pages and validate pages

  1. Authentication is the process of obtaining identification credentials such as name and password from a user and validating those credentials against some authority. If the credentials are valid, the entity that submitted the credentials is considered an authenticated identity. Once an identity has been authenticated, the authorization process determines whether that identity has access to a given resource.
  2. The following code reduces huge checks for session and validation of pages.
  3. step1 :
  4. web.config: <authentication mode="Forms"> <forms name=".ASPXAUTH" loginUrl="LoginUser.aspx" timeout="60"/> </authentication> <authorization> <deny users="?"/> </authorization> </system.web> <!-- I have commented this becauze before i dont need to dispaly any pages. If you want to display any pages before login, then write those page names here. as I mentioned here registraion page is required before login so write this page in this section after close tag of system.web <location path="registrationpage.aspx"> <system.web> <authorization> <allow users="*" /> </authorization> </system.web> </location> -->
  5. step2 :
  6. create a class name named basepage or you can specify any name using System.Resources; using System.Web.SessionState; public class BasePage : System.Web.UI.Page { // Resource Manager for localization protected ResourceManager LocalizationResourceManager; public string ContentAlignment; public static string GetConfigValue(string Name) { return ((string)( ConfigurationManager.AppSettings["ConnStr"])); } protected override void Render(System.Web.UI.HtmlTextWriter writer) { writer.RenderBeginTag(HtmlTextWriterTag.Html); base.Render(writer); writer.RenderEndTag(); } protected override void OnInit(System.EventArgs e) { string cookieName = FormsAuthentication.FormsCookieName; HttpCookie authCookie = Context.Request.Cookies[cookieName]; if (!(authCookie == null)) { if ((Session["UserID"] == null)) { FormsAuthentication.SignOut(); Response.Redirect(Request.RawUrl); } else if ((((int)(Session["UserID"])) == 0)) { FormsAuthentication.SignOut(); Response.Redirect(Request.RawUrl); } } } protected override void OnLoad(System.EventArgs e) { } }
  7. step3 :
  8. each form has to be inherited with this page. login page before redirecting append this code using System.Security.Principal; public partial class LoginUser : BasePage string lstrRoles = "Logged"; FormsAuthenticationTicket authTicket = new FormsAuthenticationTicket(1, this.txtlogin.Text, DateTime.Now, DateTime.Now.AddMinutes(60), false, lstrRoles); string encTicket = FormsAuthentication.Encrypt(authTicket); // Create the cookie. Response.Cookies.Add(new HttpCookie(FormsAuthentication.FormsCookieName, encTicket)); FormsIdentity id = new FormsIdentity(authTicket); string[] roles = authTicket.UserData.Split(((char)('|'))); GenericPrincipal principal = new GenericPrincipal(id, roles); Context.User = principal; response.redirect("inbox.aspx");
  9. step4 :
  10. very important All pages has to be inherited with this class page should be replaced with this method protected override void OnLoad(EventArgs e) { //all pageload code comes here }
Reference : 1)http://msdn.microsoft.com/en-us/library/eeyk640h.aspx 2)My friend suhail ahmed

Query XML Data in Sql 2005

que
  1. Sql Server 2005 includes subset of the XQuery language
  2. Xquery is a language for query data stored using Xml Data Type
  3. DDL operation on xml column
  4. Syntax to retrieve a date from a column of xml data type< Select columnname .query (‘/nodename’) from TableName Select columname .query (‘/nodename/childnodename’) from TableName Note: other clause of select such as ’ where’ clause can be use in above statements and column should be xml type nodename refer to element name
  5. DML operation on Xml
  • INSERT
  • Syntax : Insert into tablename (columname,Xmlcolumname) values (1 ,”Xquery”) Note :xmlcolumn name can be second or third column according to table definition and valid xml data should be inserted in xml column
  • UPDATE
  • I)as first II) as last III)into Iv)after V)before VI)Delete VII)Replace value of As Last & As First Syntax:Update table name set columnname.modify(‘insert microsoft as last into (/book[1]) ’) Note: as last and as first same syntax .column should be xml type After & before Syntax:Update table name set columname.modify(‘insert james after into (book /pubs[1]) ’) Note: after and before same syntax .column should be xml type Delete Syntax:Update table name set columname.modify(‘ delete /book/pubs/auother ’) Note:Enter element name with path colum should be xml type Replace value of particular element Syntax:Update table name set columname.modify(‘ replace value of (book /pubs/text())[1] with ‘‘sql’’ ’) Note:Enter element name with path colum & text() colum should be xml type
Refered links http://msdn.microsoft.com/en-us/library/ms345122(SQL.90).aspx http://msdn.microsoft.com/en-us/library/ms971534.aspx http://msdn.microsoft.com/en-us/library/ms345117.aspx http://blogs.msdn.com/mrorke/archive/2005/04/13/407921.aspx