?
Solved

ASP.NET:

Posted on 2014-09-30
2
Medium Priority
?
170 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 2000 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 29

Expert Comment

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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

777 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