Pages

Subscribe:

Ads 468x60px

Friday, September 9, 2011

how to encrypt password in ASP.net using C#

if you are searching for an encrypting password hashing algorithm than you are at right place, make sure before using this method that this algo is one way, means it has no decrypt method. just copy and past
here is the code for your aspx.cs file.

firstly include following files.
using System.Security.Cryptography;
using System.Text;
here is the function call.
protected void LoginButton_Click()

    {
   txt_lable.Text = getEncryptedCode(txt_passwrod.Text);
    
} 

 public static string getEncryptedCode(string inputString)
        {
            byte[] tmpSource;
            byte[] tmpHash;
            int index = 0;
            int hashLength = 0;
            tmpSource = ASCIIEncoding.ASCII.GetBytes(inputString);
            tmpHash = new SHA512Managed().ComputeHash(tmpSource);
            hashLength = tmpHash.Length;
            StringBuilder outputString = new StringBuilder(hashLength);
            for (index = 0; index < hashLength; index++)
            {
                outputString.Append(tmpHash[index].ToString("X2"));
            }
            return outputString.ToString();
        } 

Heading Types in HTML

there are 6 type of heading in html

This is a heading

This is a heading

This is a heading

This is a heading

This is a heading
This is a heading

how to make simple html page

HTML stands for Hyper Text Markup Language, in order to make a simple html page you just need to copy the below code in any editor such as note pad or you can use Dream viewer, and save the file as test.html
here is the code
"
  
     Page Title
 

Hello World This is My first HTML page.
"

Thursday, September 8, 2011

how to get server side text box value on client side using javascript

in order to access a text box or lable or any form element of server side to client side using javascript than just copy the blew code and that's it.


redirect in asp.net

it is very simple to redirect your webpage to another webpage or just to another website just copy the below code in the event where you want to use.

code for aspx.cs
Response.Redirect("mypage.aspx");

how to disable the asp.net button on page load Server side

Mention blow code will help you to make an asp.net button disable on server side page load event you can use it as per your requirement i.e. onclick event or where ever your want.

Code in .aspx page

Code aspx.cs File
protected void Page_Load(object sender, EventArgs e)
    {
    Button1.Enabled = false;
    }

Print using Javascript

Mention below code will help you to print the data in a div tag and is 100% tested on all browsers, you just need to copy and past and change the parameter as per your requirement..

Function call on button's onclientClick event

copy the below code under Javascript tag