Solved

ASP.NET:

Posted on 2014-09-30
2
165 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …

679 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