why wont to go the page 2

Posted on 2009-04-29
Last Modified: 2012-05-06
What is wrong with this code? It wont transfer to page 2.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="login.aspx.cs" Inherits="WebApplication1.login" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="" >

<head runat="server">

    <title>Untitled Page</title>



    <form id="form1" runat="server">



            Log In</h1>


            <asp:Label ID="username" runat="server" Text="User Name:"></asp:Label>


            <asp:TextBox ID="user_name_box" runat="server" MaxLength="15"></asp:TextBox>

            &nbsp;<asp:RegularExpressionValidator ID="RegularExpressionValidator1" 

                runat="server" ControlToValidate="user_name_box" 

                ErrorMessage="Please enter a valid user name" 


            &nbsp;<br />

            <asp:Label ID="password" runat="server" Text="Password: "></asp:Label>

            <asp:TextBox ID="password_box" runat="server"></asp:TextBox>

            <br />



            <asp:Button ID="Button1" runat="server" Text="Login" 

                onclientclick="shop.aspx" />



            Click here if your a new user</p>





Open in new window

Question by:texans
    LVL 9

    Accepted Solution


    That should describe of what kind your problem with the onclientclick event is. However you might want to look into .Net integrated security solutions such as before going down that road.
    LVL 22

    Assisted Solution


    It seems you are doing something wrong. Button1 is a server control and you should write your login script in onclick event of this control in code behind file. in .net, you are not require to submit your form to other page to process input..

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now