1
Posted on 6:20 AM by prajeesh and filed under , ,
Printing is a common feature needed in almost every type of web pages, there is a plenty of options to include print feature in your web page, i would like to describe two methods.

1.Printing Using java script
It is a simple task

This HTML code will return a Print button and you can click this button to print your web page.

2.Printing using web controls using ASP.net

Little programming effort is needed for printing web controls in your ASP.net application.
If you want to print contents of a web control in your ASP.net page, you can use following code segment, it is also using javascript for printing but it prints selected control only.
///
/// Prints any web control Grid view, DataGrid, Page , Panel etc.
///
///

public static void PrintWebControl(Control ctrl)
{
String Script;
StringWriter stringWrite = new StringWriter ();
HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
if ( ctrl is WebControl )
{
Unit w = new Unit(400, UnitType.Pixel);
((WebControl)ctrl).Width = w;
}
Page pg = new Page ();
if (Script != string.Empty )
{
pg.RegisterStartupScript ("PrintJavaScript",Script);
}
HtmlForm frm = new HtmlForm ();
pg.Controls.Add (frm);
frm.Attributes.Add ("runat","server");
frm.Controls.Add (ctrl);
string scr = " ";
htmlWrite.Write(scr);
pg.DesignerInitialize();
pg.RenderControl(htmlWrite);
string strHTML = stringWrite.ToString();
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.Write(strHTML);
HttpContext.Current.Response.Write(" ");
HttpContext.Current.Response.End();
}
You can pass the control to be printed as a parameter of PrintWebControl(Control ctrl) function.
Happy coding Shout it kick it on DotNetKicks.com
0
Posted on 5:37 AM by prajeesh and filed under , , ,
In certain occasions you may need to export / import large excel spreadsheet to SQL server data base. In this small and simple article i would like to demonstrate the process of exporting / importing Excel Data into SQL server database.
Step 1:
I am assuming you have created a folder and uploaded your Microsoft Excel worksheet in that folder.
Step 2:
You can create class for creating an export function
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.OleDb;
///
/// Class for Exporting Excel Data to SQL server
///

public class clsExcelToSqlServer
{
public clsExcelToSqlServer()
{
//
// TODO: Add constructor logic here
//
}
private string _FilePath;
public String FilePath
{
get { return _FilePath; }
set { _FilePath = value; }
}
public DataTable getDataFromExcelSheet()
{
try
{
//File path of Excel Spread sheet
FilePath = HttpContext.Current.Server.MapPath(HttpContext.Current.Request.ApplicationPath) +
"/ExcelFolder/ExcelAppliance.xls";
//Connection string to connect Excel data
string strConnectionString = string.Empty; strConnectionString =
@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
+ FilePath + @";Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1""";
OleDbConnection cnCSV = new OleDbConnection(strConnectionString);
cnCSV.Open();
//Selecting all rows from excel sheet
OleDbCommand cmdSelect = new OleDbCommand(@"SELECT * FROM [Sheet1$]", cnCSV);
OleDbDataAdapter daCSV = new OleDbDataAdapter();
daCSV.SelectCommand = cmdSelect;
DataTable dtCSV = new DataTable();
//Filling excel data into data table
daCSV.Fill(dtCSV);
cnCSV.Close();
daCSV = null;
return dtCSV;
}
catch (Exception ex)
{
return null;
}
finally { }
}
}
getDataFromExcelSheet() function returns a Data Table and you can use this Data table to export data into to SQL Server.
Shout it kick it on DotNetKicks.com
0
Posted on 12:23 AM by prajeesh and filed under


Kerala Microsoft user group (K-Mug) launch is on October 25th, For more details visit K-Mug Official website Shout it kick it on DotNetKicks.com
0
Posted on 8:21 AM by prajeesh and filed under
Silverlight 2 is released, you can download it from Here.
See Scot Gu's annoucement regarding silverlight relese   Follow here .
Silver light 2 comes with dozens of built in UT controls that can be used to build applications, some are  Silverlight DataGrid, RadioButton, CheckBox and DatePicker controls.
You can start learning silver light 2 Here
Shout it kick it on DotNetKicks.com
2
Posted on 8:23 AM by prajeesh and filed under , , ,

RSS feeds or "Rich Site Summery" are XML documents that used to publish freequently updated works, and RSS document or Web feed includes full summerized text and meta data RSS is also known as "Really Simple Syndication". For detailed information regarding RSS Feeds visit here http://en.wikipedia.org/wiki/RSS_(file_format.
Sample RSS File


<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="0.91">
<channel>
<title>Prajeesh's ASP.net Tech blog</title>
<link>http://www.prajeeshkk.blogspot.com</link>
<description>Web development help - By Prajeeesh </description>
<language>en-us</language>
<image>
<title>Prajeesh's Blog</title>
<url>http://www.prajeeshkk.blogspot.com/</url>
<link>http://www.prajeeshkk.blogspot.com/</link>
<width>90</width>
<height>36</height>
</image>
<item>
<title>Attack Update</title>
<link>http://www.prajeeshkk.blogspot.com/</link>
<description>
This is a test content for my test RSS document:My blog contains posts based on Web development, Web design , ASP.net development, javascript, HTML and CSS
By Prajeesh, October 22, 2008
</description>
</item>
<item>
<title>Test Post Second.ca</title>
<link>http://www.prajeeshkk.blogspot.com/</link>
<description>
This is another post content for testing RSS feeds
By Prajeesh, October 22, 2008
</description>
</item>
</channel>
</rss>

Creatting an RSS Feed using asp.net with C#
Step 1
Create a class clsRss and copy following code in the class.
using System;using System.Data;
using
System.Configuration;
using
System.Web;
using
System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml;
using System.Data.SqlClient;
using System.Text;
/// <summary>/// Summary description for clsRss

///
</summary>public class clsRss

{

clsArticle ObjArticle = new clsArticle();
public clsRss()
{

//
// TODO: Add constructor logic here//
}
public void CreateRss_Recent()
{
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ContentType = "text/xml";XmlTextWriter objX = new XmlTextWriter(HttpContext.Current.Response.OutputStream, Encoding.UTF8);objX.WriteStartDocument();
objX.WriteStartElement("rss");
objX.WriteAttributeString("version","2.0");
objX.WriteStartElement("channel");
objX.WriteElementString("title", "prajeesh's Tech blog- Recent articles ");
objX.WriteElementString("link",http://www.testsite.com/rss.aspx);
objX.WriteElementString("description","Latest articles from your site .");objX.WriteElementString("copyright","(c) 2008, Your web solutions. All rights reserved.");
objX.WriteElementString("ttl","5");//
// Suppose Article_Recent_Rss() is a function that returns data table with columns Title,Description,link & Pubdate
//
DataTableReader objReader = ObjArticle.Artilce_Recent_Rss().CreateDataReader();
while (objReader.Read()){
objX.WriteStartElement("item");
objX.WriteElementString("title",objReader["Title"].ToString());
objX.WriteElementString("description",objReader["Summery"].ToString());
objX.WriteElementString("link",objReader["articleurl"].ToString() );
objX.WriteElementString("pubDate",objReader["Postdate"].ToString() );
objX.WriteEndElement();
}objReader.Close();
objX.WriteEndElement();
objX.WriteEndElement();
objX.WriteEndDocument();
objX.Flush();
objX.Close();
HttpContext.Current.Response.End();
}
}Step 2
in the page load event of feeds page, write the following code.
public partial class rss : System.Web.UI.Page
{
clsRss ObjRss = new clsRss();
protected void Page_Load(object sender, EventArgs e){
ObjRss.CreateRss_Recent(); }} Shout it kick it on DotNetKicks.com
1
Posted on 7:50 AM by prajeesh and filed under , , ,
Do you want to play your favourite music when someone opens your website?
just upload the file you want to play and add the following code
<object data="music.mp3" type="application/x-mplayer2" width="0" height="0" >
<param name="filename" value="Testmusic.mp3" >
<param name="autostart" value="1" >
<param name="playcount" value="true" >
< /object&gt

This is a cross browser script, but the browser must be installed with Apple Quicktime plugin.




Shout it kick it on DotNetKicks.com
0
Posted on 7:32 AM by prajeesh and filed under , ,
I written a post regarding forms based authentication earlier, in one of my recent project i excluded some pages from forms based authentication so everyone can access that pages. for doing this you need to include seperate sections in web.config file for the pages to be excluded.
Example:
location path="add_new_articles.aspx" allowOverride="true" >

<system.web >

<authorization >
<
deny users ="?" />

</

authorization >
</
system.web >

</location >

Shout it kick it on DotNetKicks.com
0
Posted on 1:39 AM by prajeesh and filed under , ,
Google enters browser war by releasing new browser "Chrome". Chrome is a browser that combines a minimal design with sophisticated technology to make the Web faster, safer, and easier, you can download it from Here

Main features of Chrome are:
1. One Text box for searching and browsing
Type in the address bar and get suggestions for both search and web pages.
2. Thumbnails of your websites
Access your favorite websites instantly with lightning speed from any new tab.
(Actually opera introduced this feature they called it as speed dial).
3. Shortcuts for your applications
Get desktop shortcuts to launch your favorite web applications.
4. Easy bookmarking
you can bookmark a page by Just click the star icon at the left edge of the address bar .
5. Importing settings
You can import settings from existing browser like Mozilla, Internet Explorer ..etc
6. Safe Browsing
Google chrome warns if you visits a malicious or unsafe websites.
7. Dynamic Tabs
you can drag tabs out of the browser to create new windows.
8. Private browsing
If you dont want to show pages you visited to show in browser history , then you can use incognito mode
9. Simple downloads
you can see downloads at the bottom of your current window.


Video - The story Behind Chrome







Ten features of Google Chrome






Shout it kick it on DotNetKicks.com
1
Posted on 10:48 PM by prajeesh and filed under , ,
Microsoft SQL Server Express edition provides you a simple solution to create and manage your database for free of cost, it supports SQL Server 2005 programming model so it supports Transact-SQL, stored procedures, views, triggers, SQL Server CLR Integration (SQLCLR), and the XML data type.
Creating an SQL Server Express database:
You can create SQL Server database in two ways:

1.Using Visual Web Developer

In Visual Web Developer, open Solution Explorer, right-click the App_Data folder of your Web application, and then click Add New Item.
or
If your application does not have an App_Data folder, right-click the root folder of your Web application, click Add ASP.NET Folder, and then click App_Data.
Click SQL Database, type a name for the .mdf database file, and then click Add.
Two files are created: DataBaseName.mdf and DataBaseName_log.ldf.

2.Using tools provided by SQL Server Express edition
You can also create SQL server database by using CREATE DATABASE command or other tools provided by SQL Server Express Edition management studion

Connecting SQL Server Express Edition Database with ASP.net application:
You can connect to SQL Server Express database just like you connect to any SQL server Database by specifying database server as the local sql server express edition database.
or
you can also specify an attached Database file in App_Data folder.

Connection Strings

1.Specifying database server as the local SQL Server Express Edition database:
Data Source=.\SQLEXPRESS;Initial Catalog=MyDataBaseName;Integrated Security=True;
2.Specifying an attached database file in App_Data folder:
Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=DataDirectory I MyDataBaseName.mdf;
Shout it kick it on DotNetKicks.com
0
Posted on 9:36 PM by prajeesh and filed under ,

If you have a page that takes long time to display it is a good idea to display a "wait page loads" image. This post show you how to implement this in your webpage.

To implement this you will need to:

1. Every time your page loads a "init()" function will load.

<body onLoad="init()">

2. Define a div named "loading" right after <body> section.

<div id="loading" style="position:absolute; width:100%; text-align:center; top:300px;">


<img src="loading.gif" border=0></div>

The loading.gif image should be an animated gif that suggests that the page is still loading.

3. Place this javascript code right after you define the div.

<script>
var ld=(document.all);
var ns4=document.layers;
var ns6=document.getElementById&&!document.all;
var ie4=document.all;
if (ns4)
ld=document.loading;
else if (ns6)
ld=document.getElementById("loading").style;
else if (ie4)
ld=document.all.loading.style;
function init()
{
if(ns4){ld.visibility="hidden";}
else if (ns6ie4) ld.display="none";
}
</script>
Shout it kick it on DotNetKicks.com
0
Posted on 5:20 AM by prajeesh and filed under ,

Zephyr is a slick, feature rich and affordable Test Management System aimed at global SME, IT Departments and Testing Vendors. It brings a whole bunch of innovation in a space that has lacked it for the longest time. We'd like to draw your attention particularly to our customized Testing Desktops, real time Collaboration and Live Reporting via slick Dashboards as well as a host of Web 2.0 features.

company is telling which is a next generation Test Management System and wanted to introduce you to it by providing an exclusive look. Here's a live demo link – http://demo.yourzephyr.com/ – and there you'll be able to interact with the system anytime. They,ve loaded it with sample data to facilitate any product reviews. You'll find other assets (screenshots etc.) on the Media section of main website – http://www.getzephyr.com/.


Shout it kick it on DotNetKicks.com
0
Posted on 4:03 AM by prajeesh and filed under ,
Motivating Quotes/Inspiring quotes for you :
This post is not related to technology aspects, rather it is some quotes I inspired and I would like to post it here for motivating all readers. enjoy


“To be a great champion you must believe you are the best. If you’re not, pretend you are.”
-Muhammad Ali
"Minds are like parachutes - they only function when open."
-Thomas Dewar
A happy person is not a person in a certain set of circumstances, but rather a person with a certain set of attitudes."
-Hugh Downs
"You are as young as your faith, as old as your doubt, as young as your self-confidence, as old as your fear, as young as your hope, as old as your despair.”
- Paul H. Duhn
"Weakness of attitude becomes weakness of character."
-Albert Einstein
"I never saw a pessimistic general win a battle."
- General Dwight David Eisenhower
"An optimist is a person who sees a green light everywhere. The pessimist sees only the red light. But the truly wise person is color blind."
-Dr. Albert Schweitzer
"Eagles come in all shapes and sizes, but you will recognize them chiefly by their attitudes."
-Charles Prestwich Scott
"Alone we can do so little; together we can do so much."
-Helen Keller
"Teamwork is the ability to work together toward a common vision. The ability to direct individual accomplishments toward organizational objectives. It is the fuel that allows common people to attain uncommon results."
-Andrew Carnegie
"Coming together is a beginning, staying together is progress, and working together is success."
- Henry Ford
"The achievements of an organization are the results of the combined effort of each individual."
-Vince Lombardi
"The nice thing about teamwork is that you always have others on your side."
-Margaret Carty
"When your team is winning, be ready to be tough, because winning can make you soft. On the other hand, when you team is losing, stick by them. Keep believing."
-Bo Schembechler
"Individuals play the game, but teams beat the odds."
-SEAL Team saying
"The way a team plays as a whole determines its success. You may have the greatest bunch of individual stars in the world, but if they don't play together, the club won't be worth a dime."
-Babe Ruth
"If a team is to reach its potential, each player must be willing to subordinate his personal goals to the good of the team."
- Bud Wilkinson
"People have been known to achieve more as a result of working with others than against them."
-Dr. Allan Fromme
"When he took time to help the man up the mountain, lo, he scaled it himself."
-Tibetan Proverb
"Even eagles need a push."
- David McNally
There is no achievement without goals."
-Robert J. McKaine
"Goals in writting are dreams with deadlines. "
-Brian Tracy

"Setting goals for your game is an art. The trick is in setting them at the right level neither too low nor too high."
-Greg Norman
"Nothing can stop the man with the right mental attitude from achieving his goal; nothing on earth can help the man with the wrong mental attitude."
- Thomas Jefferson
"My philosophy of life is that if we make up our mind what we are going to make of our lives, then work hard toward that goal, we never lose - somehow we win out."
-Ronald Reagan
"Having an exciting destination is like setting a needle in your compass. From then on, the compass knows only one point-its ideal. And it will faithfully guide you there through the darkest nights and fiercest storms."
- Daniel Boone
An average person with average talent,ambition and education, can outstrip the most brilliant genius in our society,if that person has clear,focused goals.
-Brian Tracy
"Our strength lies, not alone in our proving grounds and our stockpiles, but in our ideals, our goals, and their universal appeal to all men who are struggling to breathe free."
-Adlai Ewing Stevenson
"To solve a problem or to reach a goal, you...don't need to know all the answers in advance. But you must have a clear idea of the problem or the goal you want to reach."
-W. Clement Stone
Goals.There's no telling what you can do when you get inspired by them.There's no telling what you can do when you believe in them.There's no telling what will happen when you act upon them.
-Jim Rohn
"High achievement always takes place in a framework of high expectation."
-Jack Kinder
"Man is always more than he can know of himself; consequently, his accomplishments, time and again, will come as a surprise to him."
-Golo Mann
"Trust yourself. Create the kind of self that you will be happy to live with all your life. Make the most of yourself by fanning the tiny, inner sparks of possibility into flames of achievement."
- Foster C. Mcclellan
"I am always doing things I can't do, that's how I get to do them." -Pablo Picasso
"The measure of a man is the way he bears up under misfortune."
-Plutarch
"No bird soars too high if he soars with his own wings."
-William Blake
"Destiny is not a matter of chance, it is a matter of choice; it is not a thing to be waited for, it is a thing to be achieved."
- William Jennings Bryan
"Everyone is trying to accomplish something big, not realizing that life is made up of little things."
- Frank Clark
"This became a credo of mine . . . attempt the impossible in order to improve your work."-Bette DavisThere is only one success - to spend your life in your own way."
- Christopher Morley
"I am still determined to be cheerful and happy, in whatever situation I may be; for I have also learned from experience that the greater part of our happiness or misery depends upon our dispositions, and not upon our circumstances."
- Martha Washington
"Don’t limit investing to the financial world. Invest something of yourself, and you will be richly rewarded."
- Charles Schwab
"Whoever is happy will make others happy too. He who has courage and faith will never perish in misery."
-Anne Frank
I"m so optimistic I'd go after Moby Dick in a row boat and take the tartar sauce with me.
-Zig Ziglar

"If men would consider not so much wherein they differ, as wherein they agree, there would be far less of uncharitableness and angry feeling in the world."
-Joseph Addison
"The person who has a firm trust in the Supreme Being is powerful in his power, wise by his wisdom, happy by his happiness."
-Joseph Addison
"Pleasure is not happiness. It has no more importance than a shadow following a man."
-Muhammad Ali
"To love is to suffer. To avoid suffering one must not love. But then one suffers from not loving. Therefore, to love is to suffer; not to love is to suffer; to suffer is to suffer. To be happy is to love. To be happy, then, is to suffer, but suffering makes one unhappy. Therefore, to be happy one must love or love to suffer or suffer from too much happiness."
-Woody Allen
"We must dare to be happy, and dare to confess it, regarding ourselves always as the depositories, not as the authors of our own joy."
-Henri Frederic Amiel
"Happiness, it is said, is seldom found by those who seek it, and never by those who seek it for themselves."
-F. Emerson Andrews
"If happiness is activity in accordance with excellence, it is reasonable that it should be in accordance with the highest excellence."
-Aristotle
"Very little is needed to make a happy life; it is all within yourself, in your way of thinking."
-Marcus Aurelius Antoninus
"The best way to pay for a lovely moment is to enjoy it."
-Richard David Bach
"Happiness is a conscious choice, not an automatic response."

-Mildred Barthel
"Happy the man who, like Ulysses, has made a fine voyage, or has won the Golden Fleece, and then returns, experienced and knowledgeable, to spend the rest of his life among his family!"
-Joachim Du Bellay
"For every minute you are angry, you lose sixty seconds of happiness."
-Ralph Waldo Emerson
"Happiness is a perfume you cannot pour on others without getting a few drops on yourself."
-Ralph Waldo Emerson
"Of cheerfulness, or a good temper — the more it is spent, the more of it remains."
-Ralph Waldo Emerson
"If thou wilt make a man happy, add not unto his riches but take away from his desires."
-Epicurus
"It is the chiefest point of happiness that a man is willing to be what he is."
-Desiderius Erasmus
"Account no man happy till he dies."-Euripides"The difference between the impossible and the possible lies in a person's determination."
-Tommy Lasorda
"Nothing great will ever be achieved without great mean, and men are great only if they are determined to be so."
- Charles De Gaulle
"If your determination is fixed, I do not counsel you to despair. Few things are impossible to diligence and skill. Great works are performed not by strength, but perseverance."
-Samuel Johnson
"What this power is I cannot say; all I know is that it exists and it becomes available only when a man is in that state of mind in which he knows exactly what he wants and is fully determined not to quit until he finds it."
- Alexander Graham Bell
"I am doing a great work and I cannot come down. Why should the work stop while I leave it and come down to you?"
- Bible
"Nothing can resist the human will that will stake even its existence on its stated purpose."
-Benjamin Disraeli
"The longer I live, the more I am certain that the great difference between the great and the insignificant, its energy - invincible determination - a purpose once fixed, and then death or victory."
-Sir Thomas Fowell Buxton
"You can do what you have to do, and sometimes you can do it even better than you think you can."
- Jimmy Carter
"We will either find a way, or make one!"
- Hannibal
"A determined soul will do more with a rusty monkey wrench than a loafer will accomplish with all the tools in a machine shop."

-Robert Hughes
"Every worthwhile accomplishment, big or little, has its stages of drudgery and triumph; a beginning, a struggle and a victory."
- M.K.Ghandi
"Bear in mind, if you are going to amount to anything, that your success does not depend upon the brilliancy and the impetuosity with which you take hold, but upon the ever lasting and sanctified buldoggedness with which you hang on after you have taken hold."
-Dr. A. B. Meldrum


Shout it kick it on DotNetKicks.com
0
Posted on 5:40 AM by prajeesh and filed under , , ,
Happy news for Developers,designers and engineers,
Today i found an exciting online website for flow chart chart drawing(
www.flowchart.com), this is a web 3.0 software service after registering in this site you can create Flow charts, engineering drawings Organization chart and other drawings using this website, you can also drag and drop shapes,arrows and cliparts and customize it, created documents can be converted into pdf or png ,i created one flowchart today i stunned by its performance and speed, site is in beta now, registration is free.
Have a try this
Url:
http://www.flowchart.com/


Website screen shots



Shout it kick it on DotNetKicks.com
0
Posted on 4:01 AM by prajeesh and filed under ,
Hi watch this funny video

Uploaded by crazy cat
Shout it kick it on DotNetKicks.com
0
Posted on 12:07 AM by prajeesh and filed under , ,
Web 2.0

Figure1:a tag cloud constructed by Markus Angermeier presenting some of the themes of web 2.0
Figure2:Web 2.0 Meme Map
Characteristics:
Web 2.0 Web 2.0 websites allow users to do more than just retrieve information.
They can build on the interactive facilities of "Web 1.0" to provide "Network as
platform" computing, allowing users to run software-applications entirely through a browser.
A Web 2.0 website must include:
1. CSS
2. Folksonomies (collaborative tagging, social classification, social indexing, and
social tagging)
3. Microformats extending pages with additional semantics
4. REST and/or XML- and/or JSON-based APIs
5. Rich Internet application techniques, often Ajax-based
6. Semantically valid XHTML and HTML markup
7. Syndication, aggregation and notification of data in RSS or Atom feeds
8. mashups, merging content from different sources, client- and server-side
9. Weblog-publishing tools
10. wiki or forum software, etc., to support user-generated content
11. Internet privacy, the extended power of users to manage their own privacy in
cloaking or deleting their own user content or profiles.
Associated innovations:
It is a common misconception that "Web 2.0" refers to various visual design elements
such as rounded corners or drop shadows. While such design elements have commonly been found on popular Web 2.0 sites, the truth is that the association is merely one of fashion,a designer preference which became popular around the same time that "Web 2.0" became a buzz word.
Refer
Oreilly and Wikipedia for more information
Shout it kick it on DotNetKicks.com
0
Posted on 8:54 PM by prajeesh and filed under , ,
Security Recommendations For a website

SSL Certificate
When you connect to a secure web server such as https://www.yourwebsite.com, the server authenticates itself to the web browser by presenting a digital certificate. The certificate is proof that an independent trusted third party has verified that the website belongs to the company it claims to belong to. A valid certificate gives customers confidence that they are sending personal information securely, and to the right place.
SSL certificates can provide you with non-forgeable proof of your website's identity, and customer confidence in the integrity and security of your online business. Customers are becoming increasingly aware of the advantages of SSL security and will often not purchase online from non-secure stores. All major web merchants use SSL security to encourage customers to buy online
An SSL certificate contains the following information:
The domain name for which the certificate was issued.
The owner of the certificate and the domain name.
The physical location of the owner.
The validity dates of the certificate.
Coding Recommendations
1.Run application with minimum previleges
To run with the minimum number of privileges needed, follow these guidelines:
Do not run your application with the identity of a system user (administrator).
Run the application in the context of a user with the minimum practical privileges.
Set permissions (ACLs, or Access Control Lists) on all the resources required for your application. Use the most restrictive setting. For example, if practical in your application, set files to be read-only. For a list of the minimum ACL permissions required for the identity of your web application.
Keep files for your Web application in a folder below the application root. Do not allow users the option of specifying a path for any file access in your application. This helps prevent users from getting access to the root of your server.
2.Guard Against Malicious user input
As a general rule, never assume that input you get from users is safe. It is easy for malicious users to send potentially dangerous information from the client to your application. To help guard against malicious input, follow these guidelines:
In forms, filter user input to check for HTML tags, which might contain script.
Never echo (display) unfiltered user input. Before displaying untrusted information, encode HTML to turn potentially harmful script into display strings.
Similarly, never store unfiltered user input in a database.
If you want to accept some HTML from a user, filter it manually. In your filter, explicitly define what you will accept. Do not create a filter that tries to filter out malicious input; it is very difficult to anticipate all possible malicious input.
Do not assume that information you get from the header (usually via the Request object) is safe. Use safeguards for query strings, cookies, and so on. Be aware that information that the browser reports to the server (user agent information) can be spoofed, in case that is important in your application.
If possible, do not store sensitive information in a place that is accessible from the browser, such as hidden fields or cookies. For example, do not store a password in a cookie.
3.Access data securely
Databases typically have their own security. An important aspect Web application security is designing a way for the application to access the database securely.
Use the inherent security of your database to limit who can access database resources. The exact strategy depends on your database and your application:
If practical in your application, use Windows Integrated security so that only Windows-authenticated users can access the database. Integrated security is more secure than using SQL Server standard security.
If your application uses anonymous access, create a single user with very limited permissions, and perform queries by connecting as this user.
Do not create SQL statements by concatenating strings that involve user input. Instead, create a parameterized query and use user input to set parameter values.
If you must store a user name and password somewhere to use as the database login credential, store them securely. If practical, encrypt or hash them.
4.Keep sensitive information safely
If our application transmits sensitive information between the browser and the server, consider using Secure Sockets Layer (SSL).
Use Protected Configuration to secure sensitive information in configuration files such as the Web.config or Machine.config files.
If you must store sensitive information, do not keep it in a Web page, even in a form that you think people will not be able to view (such as in server code).
Use the strong encryption algorithms.
5.Use cookies Securely
Do not store any critical information in cookies. For example, do not store a user's password in a cookie, even temporarily. As a rule, do not store any sensitive information in a cookie that. Instead, keep a reference in the cookie to a location on the server where the information is located.
Set expiration dates on cookies to the shortest practical time you can. Avoid permanent cookies if possible.
Consider encrypting information in cookies.
6.Guard against Denial of service threats
Use error handling (for example, try/catch blocks). Include a finally block in which you release resources in case of failure.
Configure IIS to use throttling, which prevents an application from using a disproportionate amount of CPU.
Test size limits of user input before using or storing it.
Put size safeguards on database queries to help guard against large queries using up system resources.
Put a size limit on file uploads, if those are part of your application.
For more information about security refer
MSDN Shout it kick it on DotNetKicks.com
0
Posted on 1:55 AM by prajeesh and filed under
This post is not related to technical aspects,here i would like to post some facts for avoiding computer related injuries.The computer is an essential equipment in many different occupations. However, long periods of working at a
computer can increase the chance of developing a health problem or an injury.
Muscle and joint pain
Overuse injuries of the upper limbs
Computer Vision Symptoms
Pain in the buttocks
Pain in the shoulders
Pain in the neck'
Pain in the knees
Pain in the fingers
and
eyestrain can result from inappropriate computer use. The risks can be
reduced or eliminated with proper desk arrangement, improved posture and good working habits.
The following figure shows you how to sit at a computer for avoiding the above problems at an extent

in addition to these maintain a comfortable temperature in your work area .

Happy working

Shout it kick it on DotNetKicks.com
0
Posted on 5:02 AM by prajeesh and filed under ,
If you want to remove/hide the top navigation bar(Figure:1) of the blogger blog
Figure1:

Step1:Log in to blogger blog

Step2:Select Layout from your dash board

step3:Select Template tab from layout

step4:Click Edit HTML

In this section you can see your blog's HTML



<![CDATA[

-----------------------------------------------
Blogger Template Style
Name: Rounders
Designer: Douglas Bowman
Url:www.stopdesign.com

date: 27 Feb 2004
Updated by: Blogger Team
----------------------------------------------- */
#navbar-iframe { display: none !important;}



/* Variable definitions
====================



Copy red colored css defeniton between the codes,remove this code if you want to show navigation bar again.



Shout it kick it on DotNetKicks.com
0
Posted on 4:36 AM by prajeesh and filed under , ,
If you want to track or analyze who is accessing your website you can achieve this by capture the IP address of an incoming connection to your aspx page,in ASP.net it is easy.
Request.ServerVariables["REMOTE_ADDR"] will return the ip address of the user

Example:

Lblipaddress.Text = Request.ServerVariables["REMOTE_ADDR"];

suppose Lblipaddress is a label you want show ipaddress
You can log these values to a file or some other external program as you need to. it will NOT tell you how long they stayed at any one oage or what page they are currently viewing, just when their browser asked the server for the page.If you want a detailed analytics about the visitors by showing state,city,time spent and graphical statistics you can use
Google Analytics service offered by google.
Shout it kick it on DotNetKicks.com
0
Posted on 2:54 AM by prajeesh and filed under
In this post you can see 15 beautiful and stunning websites,hope you will enjoy these designs,i appreciate your comments about each in the list.
Category: Beautiful web designs,Nice Flash Websites,Beautiful websites,Great websites,Nice web designs,Nice websites

1.Leoburnett



2.Neostream Interactive



3.
Xerox




4.2advanced





5.Bacardi

6.
Applestooranges


7.5nak
8.
bearskinrug

9.scrapblog


10.
Creaktif





11.Agencynet


12.Freedomoftheseas

13.Joshuaink


14.Adidas

15. Bcwebwise


Shout it kick it on DotNetKicks.com
0
Posted on 2:23 AM by prajeesh and filed under ,
This is one of the common requirement for DBA's or Programmers,How to import a .csv file into SQL Server data base,we can do this by bulk insert sql command ,let me explain the steps to do this.










suppose this is our .csv file and we want to import address data from this file(note:fields are separated by commas).
Next step is to create a table in your database for importing

CREATE TABLE address(name varchar(50),place varchar(50),zipcode int)

GO
in the next step we will import data from csv file,open your sql server Query Analyzer and give query as shown in the figure below










the query is
BULK INSERT address FROM 'C:\address.csv'
WITH(FIELDTERMINATOR = ',',ROWTERMINATOR = '\n'
)
GO


you can check the data using SELECT command(select * from address)

enjoy




Shout it kick it on DotNetKicks.com
0
Posted on 4:54 AM by prajeesh and filed under
Hello friends,Microsoft released internet explorer 8 beta ,ypu can download it Here , you can read new features from Here Shout it kick it on DotNetKicks.com
0
Posted on 3:59 AM by prajeesh and filed under ,
while browsing have you seen an icon before url like the following image ,this is called favorite icon,you can also give special icon for your website.this helps users to identify your website easily from favories of your web browser.





in this post i would like to briefly explain how to
give favorite icon to your website.
first you need to create an icon (
.ico) file of your logo for creating .ico files lot of free tools are available
in web one of them is
Pixel Toolbox ,after
creating .ico file,upload the file into server,you can upload the file into root
folder of your server folder or in a special folder like images,icons..etc.after
uploading insert the following code between <head> and </head> tags of your web page


<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />

change favicon.ico with your file name
enjoy.







Shout it kick it on DotNetKicks.com
4
Posted on 11:17 PM by prajeesh and filed under , ,
These three methods are used to clear session variables from the server,but the difference is
Session.Abandon includes Session.RemoveAll and also deletes the session id created for the session. So, subsequent request to .aspx page would create a new session with a new session id. Session.RemoveAll will remove all the user defined session variables but still keeps the session active.so if u want to end session you must use Session.Abandon().
Session.Clear() do the same job as Session.RemoveAll(). Shout it kick it on DotNetKicks.com
4
Posted on 9:34 AM by prajeesh and filed under , ,

In some websites we can see buttons like A A A to increse font size of your website for giving readability to disabled people also,we can do it many ways,one option is to dynamically change css or using javascript.here is a simple method using javascript to do this.


Step 1: Add the following Javascript in the insde the <HEAD> tag of your HTML.


<script language="JavaScript" type="text/javascript">


function changeFontSize(inc)


{


var p = document.getElementsByTagName('p');


for(n=0; n<p.length; n++) {


if(p[n].style.fontSize) {


var size = parseInt(p[n].style.fontSize.replace("px", ""));


} else {


var size = 12;


}


p[n].style.fontSize = size+inc + 'px';


}


}


</script>



Step 2: Insert the following HTML anywhere in your blog - you can customize the text or replace it with visual graphics (like the alphabet A - one small and the other one slightly large)

<a href="javascript:changeFontSize(1)">Increase Font Size</a>
<a href="javascript:changeFontSize(-1)">Decrease Font Size</a>

You can extend this to either all the HTML elements on your blog or limit it to only the text sections. The font size is specified in pixels.



Shout it kick it on DotNetKicks.com
0
Posted on 6:21 AM by prajeesh and filed under ,
what is a GUID? “GUID is a Globally Unique Identifier or GUID is a special type of identifier used in software applications in order to provide a reference number which is unique in the context for which it is used, for example, in defining the internal reference for a type of access point in a software application, or for creating unique keys in a database. While each generated GUID is not guaranteed to be unique, the total number of unique keys is so large that the probability of the same number being generated twice is very small.” (Wikipedia)
  • GUID ensures global uniqueness

How to create GUID in c#.net:

Guid CartGUID = Guid.NewGuid();

GUID's are very helpful when we are implementing e-commerce websites,for giving shopping cart id's.

Shout it kick it on DotNetKicks.com
0
Posted on 6:33 AM by prajeesh and filed under , ,

Hello friends,Security is a major concern when we are developing web applications
Asp.net provides you three types of authentication providers,that are windows,passport and Formss based.

Windows:
This uses capabilities of ISS for authentication,and passes the identity to code,this is the default authentication provider for asp.net.
passport:
this is an authentication service provided by Microsoft that offers a single logon facility and membership services for your asp.net website.
Forms:
Forms authentication provides you with a way to handle authentication using your own custom logic with in an ASP.NET application.
When a user requests a page for the application that requires authentication,ASP.NET checks for the presence of a special session cookie.
If the cookie is present, ASP.NET assumes the user is authenticated and processes the requested page.
If the cookie isn't present, ASP.NET redirects the user to a page you have provided as login page

This post gives you a small idea on how to configure your asp.net application for forms based authentication:

First of all you need to create a login page with two text boxes and one login button:

Refer the code below:


<
asp:Panel ID="Panel1" runat="server" CssClass="login_box_big" Width="400px">
<table ><tr>
<td align="left" class="side_menu">&nbsp; Login</td>
</tr><tr><td align="left">
<b>UserName:</b><asp:TextBox ID="txtUserName" runat="server"></asp:TextBox>
</td></tr><tr><td align="left">
<b>Password:</b>&nbsp;<asp:TextBox ID="txtPassword" runat="server"
TextMode="Password"></asp:TextBox>&nbsp;</td></tr><tr><td>

<asp:Button ID="LoginBtn" runat="server" CssClass="button"

onclick="Button1_Click" Text="Login" /></td></tr><tr><td>

<asp:Literal ID="ltrerror" runat="server" EnableViewState="False" Text="&lt;div style=&quot;background-color:red;width:300px;color:white&quot; &gt;Error: Invalid Password&lt;/div&gt;&lt;div style=&quot;height:10px;&quot;&gt;

&lt;/div&gt;"

Visible="False"></asp:Literal></td></tr></table></asp:Panel>

In Login Buttons click event write the following code:

protected void LoginBtn_Click(object sender, EventArgs e)

{

if (txtUserName.Text=="YourUserName" && txtPassword.Text=="YourPassword")
{

FormsAuthentication.RedirectFromLoginPage(txtUserName.Text,false);

}

else

{

ltrerror.Visible = true;

}

}

If you want to authenticate all pages in a folder in your application

(for exaple :Admin),put a web.config file in your folder and put the following tags inside <configuration> and <configuration/>tags

<system.web>

<authorization>

<deny users="?" />

</authorization>

</system.web>

<system.web>

<authorization>

<allow users="*" />

</authorization>

</system.web>

In the web.config file in your root of the application put the following tags inside <system.web> and </system.web> tags

<authentication mode="Forms">

<forms name="AUTH" loginUrl="~/Login.aspx" protection="All" timeout="120" path="/">

</forms>

</authentication>

<authorization>

<allow users="*"/>

</authorization>

the timeout section controls the interval at which the authentication cookie is regenerated.

Happy coding



Shout it kick it on DotNetKicks.com