Solved

ASP.NET:

Posted on 2014-09-30
2
166 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Suggested Solutions

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

742 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