You ve defined one page_load event in aspx page and same
page_load event in code behind how will prog run?

Answer Posted / sudhir sheoran

Page load of aspx will be given preference

e.g:


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default"%>

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
Response.Write("Page");
}
</script>
<head runat="server">
<title></title>
</head>

<body>
<form id="form1" runat="server">
<div>

</div>
</form>
</body>
</html>


And in Code Behind:

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Write("Behind");
}
}

SO Page will be shown as output not behind

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is it possible to change the index of primary key on table?

406


What is asp.net? How is it different from asp?

540


Why asp.net mvc is better than asp.net? : Asp.Net MVC

495


What is the asp.net control toolkit?

556


What is redirecting behavior?

521






What is role-based security in asp.net?

519


How is my content secured from unauthorized access?

515


What are the different types of events are occured when a client requests an ASP.NET page from IIS server?

583


Which methods validate all the controls on a page?

548


How does u get record no from 5 to 15 from a dataset of 100 records?

511


Can you explain how ASP.NET application life cycle and page life cycle events fire?

566


What is AutoEventWireup attribute for ?

597


How use Xml data in ASP.net?

557


What is the difference between custom controls and user controls?

475


Describe the events in the life cycle of a web application.

596