Asp.Net
Thursday, January 10th, 2008
Up until .NET there was no real error handling in ASP code. Sure, you have your "On Error Resume Next" and "On Error Goto 0", but there was no good structured error handling. I can truly say there has not been one Web application I have come across of decent ...
Posted in Asp, Asp.Net, IIS, Security | No Comments »
Tuesday, September 4th, 2007
Sometimes when you try to input text into database from your C# applications, some of the characters don't show up or show up differently. For Example: apostrophe(') is very often replaced by question mark(?). The same thing happens when you try inserting chinese or japanese characters into database.
The reason of ...
Posted in Asp.Net, C#, Databases | 2 Comments »
Tuesday, September 4th, 2007
The following method removes unwanted html tags from text. It is very useful for removing malicious code from form inputs.
// RemoveHTMLTags method removes *most* malicious code leaving allowed
// HTML in placet
public static string removeHTMLTags(string input)
{
string output = "";
// break the comments ...
Posted in Asp.Net, C#, html | No Comments »
Monday, September 3rd, 2007
Use the following method to get IP address of the hostname:
using System.Net;
public string GetIPAddress(string sHostName)
{
IPHostEntry ipEntry = Dns.GetHostByName(sHostName);
IPAddress [] addr = ipEntry.AddressList;
string sIPAddress = addr[0].ToString();
return sIPAddress;
}
Posted in Asp.Net, C# | 1 Comment »
Thursday, August 30th, 2007
301 Redirect is interpreted as "permanently moved". Setting a 301 redirect is the best and Search Engine Friendly method for redirecting a webpage. By using 301 redirect, you can move your files around, change file names and redirect your pages without losing your search engine rankings.
301 Redirect in Apache - ...
Posted in Apache, Asp.Net, CGI Perl, Cold Fusion, IIS, JSP, Linux, PHP, Ruby On Rails | No Comments »
Thursday, August 23rd, 2007
Good website has to have errors handling implemented. It looks good and it's very useful. You can set up sending emails with errors details after error occurs or save errors to database. There are three ways you can handle errors in your ASP.NET pages.
1. Page_Error Method
You can set error handling ...
Posted in Asp.Net, C# | No Comments »
Friday, August 17th, 2007
Today I have for you two very simple, but very useful methods to use in your ASP.NET programming.
First method is used to set a default button for the textbox. It's the best way to make your form submit on enter nad it's very useful if you have few forms on ...
Posted in Asp.Net | No Comments »