F
FayHuang
Hi,
I am very new beginner to ASP.NET, but I inherited this ASP.NET
project from a person who left our company. So I hope that my problem
is fairly simple to solve.
Here is the background to the problem: I am working on the "Contact
Us" page for an e-commerce website. This page consists of the main
section of the page (Contact Us fields like First Name, Last Name,
etc.) and navigation sections (Navigation bar, Search textbox,
drop-down box & button, Subscribe now textbox & button). The side,
top, bottom navigation and Search fields have been put into separate
controls.
On the aspx page, I have the following defined:
<%@ Page language="c#" Codebehind="Contact.aspx.cs"
AutoEventWireup="false" Inherits="AOpenCenter.Contact.Contact" %>
<%@ Register TagPrefix="AOC" TagName="Footer"
Src="/controls/Footer.ascx" %>
<%@ Register TagPrefix="AOC" TagName="SearchBox"
Src="/controls/SearchBox.ascx" %>
<%@ Register TagPrefix="AOC" TagName="LeftNav"
Src="/controls/LeftNav.ascx" %>
<%@ Register TagPrefix="AOC" TagName="TopNav"
Src="/controls/TopNav.ascx" %>
<%@ Register TagPrefix="AOC" TagName="Header"
Src="/controls/Header.ascx" %>
<%@ Register TagPrefix="AOC" TagName="HeadTag"
Src="/controls/HeadTag.ascx" %>
I have a button that I want to submit my contact us fields.
Here is the button definition:
<asp:ImageButton ID="ContactUsButton" onClick="OnClick_Submit"
imageURL="/images/btnSubmit.gif" Runat="server" />
OnClick_Submit is defined in the code behind:
protected void OnClick_Submit (object source,
System.Web.UI.ImageClickEventArgs e)
{
if (Page.IsValid)
{
TopLabel.Text = "Success!";
}
else
{
TopLabel.Text = "Failed!";
}
}
I am able to compile the solution with no problems.
Problem: When I try to bring up the page, the page displays an error
that "'ASP.Contact_aspx' does not contain a definition for
'OnClick_Submit'". But OnClick_Submit is clearly defined in the
code-behind. So I'm guessing that there is some conflict with the
other controls/forms on the page. Does someone know how I should go
about debugging/fixing this problem?
Thanks!
I am very new beginner to ASP.NET, but I inherited this ASP.NET
project from a person who left our company. So I hope that my problem
is fairly simple to solve.
Here is the background to the problem: I am working on the "Contact
Us" page for an e-commerce website. This page consists of the main
section of the page (Contact Us fields like First Name, Last Name,
etc.) and navigation sections (Navigation bar, Search textbox,
drop-down box & button, Subscribe now textbox & button). The side,
top, bottom navigation and Search fields have been put into separate
controls.
On the aspx page, I have the following defined:
<%@ Page language="c#" Codebehind="Contact.aspx.cs"
AutoEventWireup="false" Inherits="AOpenCenter.Contact.Contact" %>
<%@ Register TagPrefix="AOC" TagName="Footer"
Src="/controls/Footer.ascx" %>
<%@ Register TagPrefix="AOC" TagName="SearchBox"
Src="/controls/SearchBox.ascx" %>
<%@ Register TagPrefix="AOC" TagName="LeftNav"
Src="/controls/LeftNav.ascx" %>
<%@ Register TagPrefix="AOC" TagName="TopNav"
Src="/controls/TopNav.ascx" %>
<%@ Register TagPrefix="AOC" TagName="Header"
Src="/controls/Header.ascx" %>
<%@ Register TagPrefix="AOC" TagName="HeadTag"
Src="/controls/HeadTag.ascx" %>
I have a button that I want to submit my contact us fields.
Here is the button definition:
<asp:ImageButton ID="ContactUsButton" onClick="OnClick_Submit"
imageURL="/images/btnSubmit.gif" Runat="server" />
OnClick_Submit is defined in the code behind:
protected void OnClick_Submit (object source,
System.Web.UI.ImageClickEventArgs e)
{
if (Page.IsValid)
{
TopLabel.Text = "Success!";
}
else
{
TopLabel.Text = "Failed!";
}
}
I am able to compile the solution with no problems.
Problem: When I try to bring up the page, the page displays an error
that "'ASP.Contact_aspx' does not contain a definition for
'OnClick_Submit'". But OnClick_Submit is clearly defined in the
code-behind. So I'm guessing that there is some conflict with the
other controls/forms on the page. Does someone know how I should go
about debugging/fixing this problem?
Thanks!