A
achh1
Hi ,
I have created a web user control and have added a Page_PreInit and
Page_PreLoad Method, i have got AutoEventWireUP = true on both the page
and control.
But when i run and debug the application i find that the Page_PreInit
and Page_PreLoad and not getting called automatically on the control.
Is there something i am not doing correctly.
Cheers
atul
Control class code
public partial class TestReq: System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
}
void Page_PreLoad(object sender, EventArgs e) {
throw new Exception("The method or operation is not
implemented.");
}
}
I have added this control to this Page
<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="RequestExmaple.aspx.cs" Inherits="RequestExmaple" %>
<%@ Register TagPrefix="ex" TagName="webcont" Src="~/TestReq.ascx" %>
<!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>
<ex:webcont runat="server" ID="pageControl" />
</div>
</form>
</body>
</html>
I have created a web user control and have added a Page_PreInit and
Page_PreLoad Method, i have got AutoEventWireUP = true on both the page
and control.
But when i run and debug the application i find that the Page_PreInit
and Page_PreLoad and not getting called automatically on the control.
Is there something i am not doing correctly.
Cheers
atul
Control class code
public partial class TestReq: System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
}
void Page_PreLoad(object sender, EventArgs e) {
throw new Exception("The method or operation is not
implemented.");
}
}
I have added this control to this Page
<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="RequestExmaple.aspx.cs" Inherits="RequestExmaple" %>
<%@ Register TagPrefix="ex" TagName="webcont" Src="~/TestReq.ascx" %>
<!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>
<ex:webcont runat="server" ID="pageControl" />
</div>
</form>
</body>
</html>