Hello,
I am not able to display my aspx file using this directive :
********************************
<%@ Page language="C#" Codebehind="frmLogin.aspx.cs"
AutoEventWireup="false" Inherits="Test_Mono_CS.CfrmLogin" %>
********************************
I have compiled my .cs file into a library and when I access my .aspx
file via the XSP server, I get versions of this error:
********************************
System.Web.HttpException: ---> System.ApplicationException: The class
CfrmLogin cannot be found.
********************************
I have tried other directives like:
********************************
<%@ Import namespace="Test_Mono_CS" %>
<%@ Register tagprefix="TEST" Namespace="Test_Mono_CS"
Assembly="frmLogin.aspx.dll" %>
<%@ Assembly Src="/Test_Mono_CS/bin/frmLogin.aspx.dll" %>
********************************
but it can never find my class
My goal here is to test if we can use aspx files which have code behind
it .
Could anyone help me out?
Thanks to all,
Karl
R & D
2K1Soft Solutions
<%@ Page language="C#" Codebehind="frmLogin.aspx.cs" AutoEventWireup="false"
Inherits="Test_Mono_CS.CfrmLogin" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm1</title>
<meta content="Microsoft Visual Studio.NET 7.0" name="GENERATOR">
<meta content="Visual Basic 7.0" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
</HEAD>
<body MS_POSITIONING="FlowLayout">
<form id="Form1" action="frmSite.aspx" method="get" runat="server">
<P><asp:label id="Label1" runat="server"
Width="64px">Nom:</asp:label><asp:textbox id="txtNom"
runat="server"></asp:textbox><asp:requiredfieldvalidator id="reqfieldvalNom"
runat="server" ErrorMessage="RequiredFieldValidator"
ControlToValidate="txtNom"></asp:requiredfieldvalidator><BR>
<asp:label id="Label2" runat="server"
Width="64">Password:</asp:label><asp:textbox id="txtPW"
runat="server"></asp:textbox></P>
<P><asp:button id="bEntrer" runat="server"
Text="Entrer"></asp:button></P>
</form>
</body>
</HTML>
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace Test_Mono_CS
{
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public class CfrmLogin : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.WebControls.TextBox txtNom;
protected System.Web.UI.WebControls.RequiredFieldValidator
reqfieldvalNom;
protected System.Web.UI.WebControls.Label Label2;
protected System.Web.UI.WebControls.TextBox txtPW;
protected System.Web.UI.WebControls.Button bEntrer;
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form
Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.bEntrer.Click += new
System.EventHandler(this.bEntrer_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void bEntrer_Click(object sender, System.EventArgs e)
{
System.Web.UI.WebControls.Label lbl = new
System.Web.UI.WebControls.Label();
lbl.Text = "YO!!!";
this.Controls.Add(lbl);
this.bEntrer.Text="ASDFSDGFASDGFDGDFG";
}
}
}