Search This Blog

Oct 18, 2011

VALIDATING USER INPUT

Always validate all user input, whenever you have a public web site on the internet, you lose the ability to control its users.
Always provide a useful messages in your validation controls. Either assign the error message to the ErrorMessage property and leave the Text empty.
Consider the CssClass attribute of the validation controls to move the style deffinitions for the error messages to a separate CSS file.
When storing data in text or xml files, always store them in App_Data folder that is designed specifically for this purpose.

Oct 16, 2011

User Controls in ASP.NET

Los controles de usuario son super importantes, son muy similares a un web form, y tienen muchas de sus propiedades, se pueden agreagar controles desde el toolbar. Siempre tienen algunas diferencias, como por ejemplo, no cuentan son parte de Page si no que son parte de UserControl.
Tambien cabe destacar que no se pueden correr y ver en el browser como una pagina web simple, si no que tienen que insertarse en un web form para poder verlos en runtime.
Crear controles de usuario es muy beneficioso ya que podemos crear un solo control para una funcion que podemos y vamos a utilizar en muchas partes de nuestra application.
Tambien se puede agregar como se agrega cualquier control y ademas de eso se le puede crear propiedades como unicas como cualquier control normal y que dara mas funcionabilidades.

Oct 15, 2011

Navigation in ASP.NET 4.0

Users don't type just in the address of a web page directly, so it is important to offert them a clear and straighforward navigation system.
For this you need what are realative URLs and absolute URLs

Relative URLs are used to point to resources by their complete location including protocol and domain information.
Absolute URLs are mostly useful if you want to point to resources outside your own web site.

ASP.NET offers three different controls to navigate in your site: Menu, TreeView and SiteMapPath.

In addition to built-in navigation you can also programmatically send the user to a different page. ASP.Net supports two major ways to do this: client side using Response.Redirect and Response.RedirectPermanent(That's new in ASP.NET 4.0) and server side using Sever.Transfer. The redirect methods instruct the browser to fetch a new page from the server whereas the transfer method is executed at the server.

Oct 9, 2011

Tips for Creating Consistent Looking Web Pages

  1. When you create a new web site, Add a master page that you base all other pages on.
  2. As soon as you find yourself adding styling information to complex controls like GridView or TreeView and Menu, consider creating a skin for them.
  3. When creating skins or setting properties directly to the control, consider using the CssClass property instead.
  4. A great time saver is to the Template feature of VWD.
  5.  
    Remember 
    A consistent look is important to give your site a professional and attractive look.
    ASP.NET master pages define a cintralized look and feel.
    Themes are used to change the look and feel of the pages in your site and the controls they contain.