I have a website where I load a couple of ASP controls and then I want to call a codebehind
function called foo
.
After coming across this topic I learned about the events of the page life cycle. I tried almost every event that visual studio can offer, and the function foo was ALWAYS called before the rendering.
Basically what the function foo
does, it displays (using Response.Write()
method) a data from a DataSet
type (a data which was loaded in the Page_Load
function).
To be more specific, there's an asp:DropDownList
that states how the user wants the data to be sorted. I want the data to be displayed after the asp:DropDownList
and not ahead of it (the list has a default value).
Is there a way to do that? Either firing the function after the form is already rendered or after the last control (in this case, the list) is rendered or whichever way that this is possible.
Note: Remember that the data is not constant (not its size, nor its content, obviously), it is downloaded from a database each time and is written with Response.Write()
(unless there's another way to write the data - a way that'll somehow make sure it is written after the list...?).
And by the way - Yes, I did see this post (nothing helped).