Showing posts with label General. Show all posts
Showing posts with label General. Show all posts

Tuesday, October 29, 2013

How to create Contact Us page in Asp.net

Introduction: In this article I have explained how we can create contact us page in Asp,net.
Contact Us

Contact us page is a major part of websites through which users send comments, queries feedback etc. of website to admin/website owner.

Add a new webform to website. Drag and drop the Textbox, button, validation controls from Toolbox and desgin the .aspx page as shown below:
<table align="center">
    <tr><td><h1>Contact Us</h1></td><td></td></tr>
    <tr><td>Name:</td><td><asp:TextBox ID="txtname" runat="server"></asp:TextBox><asp:RequiredFieldValidator ID="rfvName" runat="server"
                                        ControlToValidate="txtname" Display="None"
                                        ErrorMessage="Enter Name" EnableTheming="True"></asp:RequiredFieldValidator></td></tr>
     <tr><td>Email:</td><td><asp:TextBox ID="txtemail" runat="server"></asp:TextBox><asp:RequiredFieldValidator ID="rfvrequireemail" runat="server"
                                        ControlToValidate="txtemail" Display="None"
                                        ErrorMessage="Enter Email" EnableTheming="True"></asp:RequiredFieldValidator>
         <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
             ControlToValidate="txtemail" ErrorMessage="Enter Valid Email"
             ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
         </td></tr>

Friday, August 30, 2013

How to Get Title, Description, Keywords Meta Tags and Image from URL in Asp.net

Introduction: In this article I will explain how we can Get Title, Description, Keywords Meta Tags and Image from URL in Asp.net.

Description:
Take a new project and put the DLL in Bin folder of Project. Bulid the project. After that add a new webform to project and design as mention below:

<table><tr><td style="width:200px;">Website Url:</td><td> <asp:TextBox ID="txtwebsiteurl" runat="server" Width="831px"></asp:TextBox></td>
</tr>
<tr><td>&nbsp;</td><td><asp:Button ID="btnGet" runat="server" Font-Bold="True" Font-Italic="True"
            onclick="btnGet_Click" Text="Fetch Details" /></td></tr>
            <tr><td>
            Title :</td><td> <asp:TextBox ID="txttitle" runat="server" Width="831px"></asp:TextBox></td></tr>

Wednesday, August 21, 2013

Recovering Forgot Password by Send Reset Link in Asp.net

Introduction: In this article I have explain how we can Send Password Reset Link in Asp.net for one time use only.
Send Password Reset Link

Description:
I create table USER_REGISTRATION:
ID
int
USERNAME
varchar(50)
FIRST_NAME
varchar(50)
LAST_NAME
varchar(50)
SEX
varchar(50)
EMAIL_ID
varchar(50)
PASSWORD
varchar(50)
CHANGE_PASSWORD_STATUS
bit

After that add a new webform to project and design the .aspx page as mention below:
<table align="center">
        <tr><td>Email:</td><td>
        <asp:TextBox ID="txtemail" runat="server" Width="150px"></asp:TextBox>
            <asp:RequiredFieldValidator ID="rfvemail" runat="server"
                ErrorMessage="Please Enter Email" ControlToValidate="txtemail"
                ForeColor="Red"></asp:RequiredFieldValidator>
            </td></tr>
        <tr><td>&nbsp;</td><td>
            <asp:Button ID="btnsend" runat="server" Text="Send" onclick="btnsend_Click" /></td></tr>
        </table>

Monday, August 19, 2013

Integrate Facebook Login authentication to website

Introduction: In this article I will explain how we can Integrate Facebook Login authentication to website.
Facebook Login authentication

Description:
To integrate Facebook authentication in website firstly we have to create Facebook App Id. For this open the link https://developers.facebook.com/apps/?action=create. If you are already loged in than you will redirect to Create App other you redirect to login page. After login to Facebook a pop up will open as shown in snapshot:
Facebook Login authentication

Enter App name and click on Continue button. Here I Enter App name Test. After that captcha window will be open and enter the text as shown in attached snapshot:
Facebook Login authentication

Now you will redirect to your App page and see the structure as attached snapshot:

Facebook Login authentication

Enter URL of your website in Site URL field (e.g. http://www.example.com) and click on save changes button.
Note: if you want to check it on localhost than enter your localhost project URL (e.g. http://localhost:1750 ) here number is your local port number, add this to Site URL field and test it. Enter the updated URL of your application because the port number of your local site can changed any time.

Add a new webform to project. After that add the Facebook Javascript SDK in between body Tag of .aspx page as mention below:

<body>
    <form id="form1" runat="server">
  
    <div id="fb-root"></div>
<script>
    window.fbAsyncInit = function () {
        FB.init({
            appId: '636863302999119', // App ID
            channelUrl: '//' + window.location.hostname + '/channel', // Channel File
            status: true, // check login status
            cookie: true, // enable cookies to allow the server to access the session
            xfbml: true  // parse XFBML
        });

        FB.Event.subscribe('auth.authResponseChange', function (response) {
            // Here we specify what we do with the response anytime this event occurs.
            if (response.status === 'connected') {
                // The response object is returned with a status field that lets the app know the current
                // login status of the person. In this case, we're handling the situation where they
                // have logged in to the app.
                document.getElementById('auth-displayname').innerHTML = me.name;
                testAPI();
            } else if (response.status === 'not_authorized') {
                // In this case, the person is logged into Facebook, but not into the app, so we call
                // FB.login() to prompt them to do so.
                // In real-life usage, you wouldn't want to immediately prompt someone to login
                // like this, for two reasons:
              
                FB.login();
            } else {
                // In this case, the person is not logged into Facebook, so we call the login()
                FB.login();
            }
        });
    };

    // Load the SDK asynchronously
    (function (d) {
        var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
        if (d.getElementById(id)) { return; }
        js = d.createElement('script'); js.id = id; js.async = true;
        js.src = "//connect.facebook.net/en_US/all.js";
        ref.parentNode.insertBefore(js, ref);
    } (document));
</script>

<!--
  Below we include the Login Button social plugin. This button uses the JavaScript SDK to
  present a graphical Login button that triggers the FB.login() function when clicked.

  Learn more about options for the login button plugin:
  /docs/reference/plugins/login/ -->

<table align="center">
<tr><td>
<div id="auth-status">
<div class="fb-login-button" show-faces="true" autologoutlink="true" scope="email,user_checkins">Login with Facebook</div>
<div id="auth-loggedout">
</div>
</td></tr>
</table>
    </form>
</body>

Run the project an check out the result.

Friday, August 9, 2013

How to Create Change Password form/page in Asp.net

Introduction: In this post I will explain how we can Change the Password in Asp.net.
Change Password

Description:

Users want to change their password. Users redirect to change password page and enter current password after that new password and confirm the password. Firstly here we check the users session on page load and after that check the current password on button click. If current password is correct than  user will be able to change the password successfully.

Wednesday, August 7, 2013

Remember Username and Password using Remember me checkbox during login in asp.net

Introduction: In this article I will epxlain how we can remember USERNAME and PASSWORD using Remember me checkbox during login in asp.net.
Remember Username and Password

Description:
I created a Table USER_REGISTRATION:
ID
int
USERNAME
varchar(50)
PASSWORD
varchar(50)
FIRST_NAME
varchar(50)
LAST_NAME
varchar(50)
SEX
varchar(50)
EMAIL_ID
varchar(50)

Here ID is autoincrement and primary key. Registers user detail/information store in table and check the username and password detlais on login page.

Friday, August 2, 2013

How to Recover Forgot Password via Send Email in Asp.net

Introduction: In this post I will explain how we can recover the lost/forgot password via email in asp.net.
Forgot Password

Forgot Password


Description:
In the last post I have explained How to Create Login Form in Asp.net OR Login Form with Check Username and Password aviabilty in Asp.net, How to create registration page in asp.net.

Users click on forgot password link and redirect to forgot password page. There user enter their Email Id and get their password details via Email.

To explain forgot Password Example I created a Table USER_REGISTRATION:
ID
int
USERNAME
varchar(50)
PASSWORD
varchar(50)
FIRST_NAME
varchar(50)
LAST_NAME
varchar(50)
SEX
varchar(50)
EMAIL_ID
varchar(50)

Here ID is autoincrement and primary key and have the record show in sanpshot:

Thursday, July 25, 2013

How to Create Login Form in Asp.net OR Login Form with Check Username and Password aviabilty in Asp.net

Introduction: In this post I will explain how we can create Login form with check Username and Password aviability  in Asp.net.
Login Form

Description:
In the last article i have explained How to Create registration form in Asp.net.

After the successfully registration to website, user redirect to login page/form of website. Users enter their username and pasword information to enter in website. If username and password is exis than they will be redirect to welcome page of website otherwise got a message for registration or Invalid user/Password.
To show user login form  Example I created a Table USER_REGISTRATION:
ID
int
USERNAME
varchar(50)
PASSWORD
varchar(50)
FIRST_NAME
varchar(50)
LAST_NAME
varchar(50)
SEX
varchar(50)
EMAIL_ID
varchar(50)

Here ID is autoincrement and primary key.
Take a new website. Add a webform to website. Drag and drop the controls from Toolbox and Design the  .aspx page as shown below:

Wednesday, July 24, 2013

How to Create Registration Form in Asp.net

Introduction: In this article I will explain how we can create simple registration form in Asp.net.
Description:
In the last article I have explained How to check Usernameor Email is exists or not.


Here I create registration form to register new user. In registration form user needs to fill First name, Last name, password, Email, Address etc. Here I validate the registration form using Jquery. See Example:


Thursday, June 20, 2013

How to check the username/email is exists or not in asp.net

Introduction:  In this article I will try to explain how we can check the Username/Email is Exists or not at the time of User registration in Asp.net.
username/email is exists or not

Description:
Here I created a table USER_REGISTRATION. USER_ID is primary key.
USER_ID
int
USERNAME
varchar(50)
FIRST_NAME
varchar(50)
LAST_NAME
varchar(50)
EMAIL
varchar(50)
PASSWORD
varchar(50)

Add a webform to project. Drag and drop the controls from Toolbox to .aspx page.