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

Answers were Sorted based on User's Feedback



You ve defined one page_load event in aspx page and same page_load event in code behind how will pr..

Answer / js_m

The Page_load method in the aspx page will only run.It takes
precedence over the one in the code behind.

Is This Answer Correct ?    18 Yes 0 No

You ve defined one page_load event in aspx page and same page_load event in code behind how will pr..

Answer / vijaykumar

The Page_load method in the aspx page will only run.

Is This Answer Correct ?    12 Yes 1 No

You ve defined one page_load event in aspx page and same page_load event in code behind how will pr..

Answer / 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

You ve defined one page_load event in aspx page and same page_load event in code behind how will pr..

Answer / arun

page load of aspx will run first 

Is This Answer Correct ?    1 Yes 0 No

You ve defined one page_load event in aspx page and same page_load event in code behind how will pr..

Answer / arvind kumar

Hi frnd,

In this case, Page_Load() method of aspx.cs takes precedence
over the Page_Load() method of aspx file.

The code assosicated with Page_Load() of aspx would not run.

Is This Answer Correct ?    6 Yes 7 No

You ve defined one page_load event in aspx page and same page_load event in code behind how will pr..

Answer / 6y787y

tu

Is This Answer Correct ?    2 Yes 5 No

Post New Answer

More ASP.NET Interview Questions

what is the difference between sql 2000 and 2005?

2 Answers   Cognizant,


When would you not use the oleDbConnection object? a) To connect to an SQL 7.0 database. b) To connect to a DB/2 database. c) To connect to an Access database. d) To connect to an SQL 6.5 database.

6 Answers   Syntax Softtech,


What is asp.net and its advantages?

0 Answers  


Is there any limit for query string? Means what is the maximum size?

0 Answers  


How do u declare static variable and how it is declared and what is its lifetime?

0 Answers  






What is the main use of Response.Output.Write()?

4 Answers   Siebel,


What is asp.net futures?

0 Answers  


How to store a dataset in a viewstate?

3 Answers   IBM,


What is httpresponse?

0 Answers  


What is the difference between system.stringbuilder and system.string

0 Answers  


When Cookies are expired in ASP.NET?

0 Answers   Sans Pareil IT Services,


Explain the server control events of asp.net ?

0 Answers  


Categories