can anyone answer this tuff question?

G

Guest

Hello All,

I am encountering a strange behavior which I want the MSDN stalwarts to
explain me in detail and your explanation is highly appreciated.

I have a User Control which is dynamically loaded from a parent page. In the
User Control, I have a DataGrid. In the datagrid's event handler for
"ItemCreated", I am dynamically adding a "LinkButton" to the footer of the
datagrid. Normally a linkbutton is rendered as an "anchor" tag in HTML to the
browser. Here comes the interesting part:

For the first time when the page is loaded, I can properly see the anchor
links in the page BUT BUT BUT when I do a "View Source" I cannot find the
anchor code which is rendered in the HTML. But when I do a post back and do a
"View Source" I can see the HTML code. Can anyone give me the reason behind
this strange behavior. I know that it has something to do with the sequence
followed by the different events in the "Page" class's lifecycle.

Is the User Controls "ItemCreated" event executed after the parent page's
"Render" event which is responsible for sending the output stream to the
browser? If that is right then how come I am able to see the links but not
the HTML code for the very first time?

Thanks a bunch!!!!!
Raghav
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top