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
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 |
Answer / vijaykumar
The Page_load method in the aspx page will only run.
| Is This Answer Correct ? | 12 Yes | 1 No |
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 |
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 |
How to create discussion forum in asp.net mvc? : Asp.Net MVC
Describe the two main components of the .NET framework ?
What tag do you use to add a hyperlink column to the DataGrid?
What would be the salary of an Asp.net developer with 1 and half year experience in indian rupees..??
Explain the difference between webfarm and webgardens in .net?
What is the default authentication mode for asp.net?
What does the "EnableViewState" property do? Why would I want it on or off?
2 Answers Photon Infotech, Siebel Systems, Syntax Softtech,
How do session tokens work?
If there are multiple update panels on the page say upd1 and upd2. There is a button placed in upd1. How can you stop upd2 to update when button placed in upd1 is clicked?
Write a code for passing ArrayList in Web API?
How do you handle server controls?
How do you declare delegates and are delegates and events one and the same and explain how do you declare delegates and invoke them ?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)