Solved

ASP.NET:

Posted on 2014-09-30
2
164 Views
Last Modified: 2014-10-02
I am new to ASP.NET, and am faced with a relatively easy task -- to make a change to an existing textbox control.

I am seeing two methods that manipulate this textbox control -- OnPreRender() and SetupGuiMap().
I am not sure in which method I should make my necessary changes.

In the OnPreRender(), it appears that the textbox is added:
private GuiMapper _gm = new GuiMapper();
...
_gm.Add( new TextBoxMap(addr.Address1, txtStreet1, lblStreet1));




In the OnPreRender(), it appears that the visibility property is touched upon:

txtStreet1.Visible = true;




I am not sure if these are standard methods in ASP.NET, but I believe these methods have a certain order in which they are called. So if for example, I change a property in one method, it might potentially be overridden in another method.
0
Comment
Question by:pzozulka
2 Comments
 
LVL 9

Accepted Solution

by:
WebDevEM earned 500 total points
ID: 40354417
Hi,

The order of events is called the page lifecycle, and if you're working in ASP.Net you'll definitely want to understand it.  There is a quick tutorial over at http://www.codeproject.com/Articles/457647/Understanding-ASP-NET-Application-and-Page-Life-Cy that should get you going.  

At a quick glance, the phases of a page's lifecycle are:
PreInit
Init
InitComplete
Preload
Load
LoadComplete
PreRender
PreRenderComplete
Unload

If your code above, the OnPreRender() is a standard function that fires during the PreRender phase.  The GuiMapper is probably a custom class (unless it has been added to the language since I used it, which admittedly has been a few years) but that is called as needed, rather than during any particular phase of the lifecycle.

When I was developing ASP.Net, I used to keep a printout of the page lifecycle tacked to the wall right in front of me as a handy reference, because there were plenty of times I needed to debug when something was happening in relation to something else.

Happy coding!

WebDevEM
0
 
LVL 28

Expert Comment

by:sammySeltzer
ID: 40354980
What change(s) are you trying to make though?
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question