ROHIT SONIJI

UseFul Programming Code

Upload A File On Web Server In Asp.net :-
protected void Button1_Click(object sender, EventArgs e)
    {
        if (FileUpload1.HasFile)
        {
            Response.Write("File Length In Bytes: " + FileUpload1.FileBytes.Length + "
" + "File Name: " + FileUpload1.FileName + "
" + "MIME Type: " + FileUpload1.PostedFile.ContentType);
            FileUpload1.SaveAs(MapPath("~/Uploads/" + FileUpload1.FileName));
        }
        else
        {
            Response.Write("No File Received...");
        }
    }
____________________________________________________________________________

AjaxEnabled :-  Create a Ajax Client Control Name With "PasswordStrengthComponent"(or With Another Name) and Write the Following Code in AjaxClientControl File:

Type.registerNamespace("AjaxEnabled");

AjaxEnabled.PasswordStrengthComponent = function() {
    AjaxEnabled.PasswordStrengthComponent.initializeBase(this);
}

AjaxEnabled.PasswordStrengthComponent.prototype = {
    initialize: function() {
        AjaxEnabled.PasswordStrengthComponent.callBaseMethod(this, 'initialize');

        // Add custom initialization here
    },
    returnPasswordStrength: function(password) {
        var strPass = new String(password.toString());
        if (strPass.length < 5) {
            return "Weak";}
        else {
            if (strPass.length < 8) {
                return "Medium";
            }
            else {
                return "Strong";
            }}},
    dispose: function() {
        //Add custom dispose actions here
        AjaxEnabled.PasswordStrengthComponent.callBaseMethod(this, 'dispose');
    }}
AjaxEnabled.PasswordStrengthComponent.registerClass('AjaxEnabled.PasswordStrengthComponent', Sys.Component);
if (typeof(Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();

In Source View :-Write in Script Tag
function _OnKeypress() {
            var checker = new AjaxEnabled.PasswordStrengthComponent();
            var pass = document.getElementById("TextBoxPassword").value;
            var strength = checker.returnPasswordStrength(pass);
            document.getElementById("LabelStrength").innerText = strength;
"TextBoxPassword" Is a TextBox Control with Password TextMode
"LabelStrength" Is a Label Control

God Is Busy...Can I Help You