Ask a Question related to ASP.NET General, Design and Development.
-
Armando Flores #1
Re: A question about the PreRender event
Hi,
I do not know if you already got an answer to this question but in
order to 'wire' the PreRender event handler using VS.net you need to:
1) Open the Page (say myPage.aspx)
2) Open the Properties dialog for that page by right clicking anyhwere
on the page and selecting the Properties menu item (last item on the
list)
3) Most likely the combo box under the Properties title will show the
HTML tag that correspons to the area where you right clicked on step
2). That's ok, scroll down the ComboBox and look for the entry that
represents the page it should look something like:
'myPage.aspx System.Web.UI.Page'
4)As soon as you select that item you will see the Events icon
(thunderbolt).
Just click on it and the Property page will show you an area where you
can enter the name of the function that will handle the event.
I hope this helps
Happy .NETing
Armando
roger <rsr@rogerware.com> wrote in message news:<Xns939F9C0535F6Drsrrogerwarecom@204.127.199. 17>...> I've got an aspx page and a class implemented in a code behind file.
>
> I have a PreRender method in my class, in order to
> do whatever needs to be done *after* all of the various
> post back event handlers have been executed.
>
> Stop me now if there's a better way to do that than adding
> a PreRender event handler on the page...
>
>
> Now, the part I don't get is this:
>
> The way to add the PreRender event is to put something like:
>
> this.PreRender += new System.EventHandler(this.Page_PreRender);
>
> in the page's InitializeComponent method, similar to the way the PageLoad
> method is registered.
>
> The mystery to me is this comment which VS.NET attaches to
> the InitializeComponent method reads
>
> /// Required method for Designer support - do not modify
> /// the contents of this method with the code editor.
>
> This begs the question, how does one add the method then?
>
> What's even more exciting is that I've seen VS.NET, on several
> occasions, delete the entire contents of the InitializeComponent
> method and leave it completely empty.
> Heck, I didn't need all those event handlers anyway:(
>
>
> As I write this, I'm thinking maybe the right thing to do is
> to add this in the OnInit method, after (or before) the call
> to InitializeComponent is made.
>
> That method doesn't claim or appear to be used by VS.NET.
>
> Am I on the right track here?
>
> Thanks.Armando Flores Guest
-
PreRender not being called, solution
If PreRender is not being called on a control, it means the control's Visible property is false. This can lead to an interesting situation. If you... -
PreRender not called on PostBack?
I have a situation where I am dynamically loading .ascx controls, and their pre-render is not getting called on postback but the page load is. Any... -
Should I use the PreRender event
I have several user controls where I am not using viewstate. In the OnLoad, I call functions that will take the data out of the form fields and... -
PreRender Datagrid Header
thanks , i have figured out the problem s_nagul2003@yahoo.co.in (Nagul) wrote in message news:<37e6a399.0307250241.ec325dc@posting.google.com>... -
Assigning events in PreRender
I have at last found a kind of solution to the problem in adding all the conditional controls and making the unwanted controls invisible in...



Reply With Quote

