Pages

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