<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" defaultLanguage="c#" />
</system.web>
</configuration>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
namespace IasobergDataDrivenWebsite
{
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
private void bnLogin_Click(object sender, EventArgs e)
{
Response.Redirect("Home.aspx");
}
}
}
<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="IasobergDataDrivenWebsite.Default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<p>
username
<asp:TextBox ID="txtUsername" runat="server"></asp:TextBox>
</p>
<p>
password
<asp:TextBox ID="txtPassword" runat="server" TextMode="Password"></asp:TextBox>
</p>
<p>
<asp:Button ID="bnLogin" runat="server" Text="Login" />
</p>
</asp:Content>
ASKER
<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="IasobergDataDrivenWebsite.Default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<p>
username
<asp:TextBox ID="txtUsername" runat="server"></asp:TextBox>
</p>
<p>
password
<asp:TextBox ID="txtPassword" runat="server" TextMode="Password"></asp:TextBox>
</p>
<p>
<asp:Button ID="Button1" runat="server" Text="Login" OnClick="bnLogin_Click" />
</p>
</asp:Content>
and I got this error: protected void bnLogin_Click(object sender, EventArgs e)
{
Response.Redirect("Home.aspx");
}
ASKER
ASKER
ASKER
The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications
TRUSTED BY
OnClick event for bnLogin is missing in "Default.aspx " . Please add the OnClick event to btnLogin . Please check the below Code. OnClick="bnLogin_Click"
Open in new window