Posts

Showing posts from December, 2015

Which page is called first in asp.net c#? Web form or Master page?

Image
Today in Engineer's World, we are discussing a C# query faced by a developer in very easy way. Posted By- +Manish Kumar Gautam+LIVE VIAR+ASP.NET SOLUTIONS
Click imagination hunt to see latest Blogs
Previous - Which page is called first in asp.net c#? Web form or Master page? Part-II
Which page is called first in asp.net c#? Web form or Master page?
Second Scenario: We take the same pages (master and web form), we are working with case one and write the below code in the page load for both pages.
Code that we write on master page
Practical Implementation:
publicpartialclassMasterPage : System.Web.UI.MasterPage { protectedvoid Page_Load(object sender, EventArgs e) { Response.Write("Master Page Loaded<br/>" + "<br/>"

Which page is called first in asp.net c#? Web form or Master page?

Image
Today in Engineer's World, we are discussing a C# query faced by a developer in very easy way. Posted By- +Manish Kumar Gautam+LIVE VIAR+ASP.NET SOLUTIONS
Click imagination hunt to see latest Blogs
Previous - Which page is called first in asp.net c#? Web form or Master page? Part-I
Which page is called first in asp.net c#? Web form or Master page?
One such scenario is - Suppose you have a master page and a nested web form page. In your master page, you write some piece of code. Like, you add a label control and write its Text property as “Master Page Load” with Red color. Note: We haven’t written any code in the code-behind for any page (neither in master nor in web form page).
Code that we write on the master page.
Practical Implementation:
<body> <formid="form1"runat="server"> <div> <asp:LabelID="Label1"

Which page is called first in asp.net c#? WebForm or Master page?

Today in Engineer's World, we are discussing a C# query faced by a developer in very easy way. Posted By- +Manish Kumar Gautam+LIVE VIAR+ASP.NET SOLUTIONS

Click imagination hunt to see latest Blogs
Previous – How to call .cs file from .aspx.cs file in asp.net c# Part-III
Which page is called first in asp.net c#? Web form or Master page?
This question is faced by every developer when they start working on Master Page. And we start searching help from Google. And everyone ends up in the blog posted by Microsoft at https://msdn.microsoft.com/en-us/library/dct97kc3.aspx
This says the following is the sequence in which events occur when a master page is merged with a web form page: Webform page PreInit event. Master page controls Init event. Webform controls Init event. Master page Init event. Webform page Init event. Webform page Load event. Master page Load event. Master page controls Load event. Webform page controls Load event. Webform page PreRender event. Master page PreRender event. Master pag…

How to call .cs file from .aspx.cs file in asp.net c#?

Image
Today in Engineer's World, we are discussinga C# query faced by a developer in very easy way. Posted By- +Manish Kumar Gautam+LIVE VIAR+ASP.NET SOLUTIONS
Click imagination hunt to see latest Blogs
Previous - How to call .cs file from .aspx.cs file in asp.net c#? Part-II
Calling .cs (class file) from .aspx.cs (webform code behind file) in Asp.net C#
We have already prepared our web form and validation class logic in our previous two blogs. Inference from our previous blogs, all we need is to call our validation class method into our web form.
For that, we have to call the validate.cs file method in  calling_cs_page_from_aspxcs.aspx.cs web form file. And this calling need to be done on click of button event.
Practical Implementation:
Code Behind code:
using System;-----> Namespace
publicpartialclasscalling_cs_page_from_aspxcs : System.Web.UI.Page { protectedvoid Page_Load(object sender, EventArgs e) { }
protectedvoid