Asp.net

Creating aspnetdb tables in to your Existing MSSQL database

Many of my asp.net web developer friends always ask me questions about aspnet db like , How to create aspnet database in MSSQL? , Is it possible to add aspnet tables and stored procedures into existing MSSQL database? etc.. So I decide to write on that, It might be useful to all.

Here is simple steps to create ASPNET Database

  1. Open visual studio command prompt and run Aspnet_regsql.exe command OR run Aspnet_regsql.exe file from C:WindowsMicrosoft.NETFrameworkv2.0.50727 directory.
  2. It opens Asp.net SQL server setup wizard,  Click on Next button
  3. Select Configure SQL server for application services , and click on Next Button
  4. Enter your database server details and select database name where you want to create aspnet table. It creates new database called aspnetdb if default database name is selected. Click on Next button. aspnetDb
  5. Confirm you details and click Next
  6. Done.
Asp.net

Asp.net: Send Compressed CSS and JS files to client browser

Why:

Compress your css and js files to load pages faster on client side. It reduces size of CSS and JS files so page size will get reduced.
Now majority of browsers support compressed files.

How

Add Global.asax file in your web application and delete all content and place following line in it,

<%@ Application Language="C#" Inherits="Global" %>

Then add Global.cs class file in your APP_CODE folder and put the following functions in it.

public class Global : System.Web.HttpApplication
{
public Global()
{
InitializeComponent();
}

private void InitializeComponent()
{
this.PostReleaseRequestState +=
new EventHandler(Global_PostReleaseRequestState);
}

private void Global_PostReleaseRequestState(
object sender, EventArgs e)
{
string contentType = Response.ContentType;

if (contentType == "text/css" ||
contentType == "application/x-javascript" || contentType == "text/javascript")
{
Response.Cache.VaryByHeaders["Accept-Encoding"] = true;

string acceptEncoding =
Request.Headers["Accept-Encoding"];

if (acceptEncoding != null)
{
if (acceptEncoding.Contains("gzip"))
{
Response.Filter = new GZipStream(
Response.Filter, CompressionMode.Compress);
Response.AppendHeader(
"Content-Encoding", "gzip");
}
else if (acceptEncoding.Contains("deflate"))
{
Response.Filter = new DeflateStream(
Response.Filter, CompressionMode.Compress);
Response.AppendHeader(
"Content-Encoding", "deflate");
}
}
}
}
}

The browser will tell the server whether it supports GZIP or DEFLATE compression (via the Accept-Encoding header). If its an older browser that doesn’t support compression, it will just be sent as uncompressed HTML and your site will still work.

Tools

2 firefox add-on to analyze page performance

Page Speed

Page Speed is an Firefox Add-on integrated with the Firebug add-on. Web developers can use Page Speed to evaluate the performance of their web pages and to get suggestions on how to improve them. Add-on requires FireBug addon installed.

pagespeed

2.YSlow

YSlow analyzes web pages and suggests ways to improve their performance based on a set of rules for high performance web pages. YSlow is a Firefox add-on integrated with the Firebug web development tool.

JQuery

jQuery SuperBox: jQuery lightbox plugin

jQuery Superbox! is a script which allows you display windows with the lightbox effect.

superbox

Features

Accessibility: only the rel attribute is used to launch the script. The href attribute is therefore coherent: it targets the address of a picture, of a page, or an element identifier (anchor).
Extensibility: Superbox doesn’t set any style, everything is easily and entirely CSS stylable.

Javascripts, JQuery, Tools

5 HTML text editors

1. FCKeditor

This lightweight HTML text editor brings to the web much of the power of desktop editors like MS Word.
Features:-

  • Multi browser compatibility
  • CSS support for better integration with your web site
  • Font formatting
  • Text formatting
  • Skins support
  • Plugins support
  • Spell checker
  • Multi-language support
  • Context menus support

2. Rich Text Editor
Free Rich Text Editor is a JavaScript WYSIWYG editor.
It can be easily integrate with any platform.
Editor lets you to switch between the design, HTML code & preview modes.

3. jWYSIWYG: jQueryPlugin

jWYSIWYG is a jQuery plugin, which transform  textarea into an editor.
It uses following simple function syntax,

$(function()
{
$(‘#wysiwyg’).wysiwyg();
});

4. Markitup : jQuery Plugin
MarkItUp is a JavaScript plugin built on the jQuery library. It allows you to turn any textarea into a markup editor.
Features

  • Lightweight
  • Powerful
  • Flexible editor engine

5. NicEdit

NicEdit is a Lightweight, Cross Platform, Inline Content Editor to allow easy editing of web site content on the fly in the browser.
NicEdit Javascript integrates into any site in seconds to make any element/div editable or convert standard textareas to rich text editing

editor