Page_PreLoad does not wire up automatically

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top