Solved

ASP.NET:

Posted on 2014-09-30
2
157 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now