Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

why wont to go the page 2

Posted on 2009-04-29
3
Medium Priority
?
160 Views
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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h1>
            Log In</h1>
        <p>
            <asp:Label ID="username" runat="server" Text="User Name:"></asp:Label>
&nbsp;
            <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" 
                ValidationExpression="/^[A-Za-z0-9]$/"></asp:RegularExpressionValidator>
            &nbsp;<br />
            <asp:Label ID="password" runat="server" Text="Password: "></asp:Label>
            <asp:TextBox ID="password_box" runat="server"></asp:TextBox>
            <br />
        </p>
        <p>
            <asp:Button ID="Button1" runat="server" Text="Login" 
                onclientclick="shop.aspx" />
        </p>
        <p>
            Click here if your a new user</p>
    </div>
    </form>
</body>
</html>

Open in new window

0
Comment
Question by:texans
2 Comments
 
LVL 9

Accepted Solution

by:
tillgeffken earned 1000 total points
ID: 24259274
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.button.onclientclick.aspx

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 http://msdn.microsoft.com/en-us/library/yh26yfzy.aspx before going down that road.
0
 
LVL 22

Assisted Solution

by:neeraj523
neeraj523 earned 1000 total points
ID: 24259687
hello

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..
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Loops Section Overview
Suggested Courses
Course of the Month13 days, 7 hours left to enroll

580 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