Evenimente WebParts


Se foloseste CreateChildControls ptr.
* Instantierea controalelor
* Adaugare evenimente la controale
* Adaugare controale la colectia Controls cu Controls.Add

Se foloseste Render ptr.
* Adaugare logica ptr. a determina daca se face sau nu display la controale
* Render controls folosind control.RenderControl()

OnPreRender:

It is called logically called before Render event of the ASP.NET page.
This is the last opportunity for us to affect the rendering behavior of the web part page.
Things like changes to the viewstate properties can be done logically in the OnPreRender event.  
Moreover the OnPreRender  event is called logically after the events EnsureChildControls and CreateChildControls

CreateChildControls:

If we need to render the ASP.NET web server controls (ike button, text box etc) in the web part,
this event needs to be overridden. Logically we can add web controls and wire the events to it

Render:

This event is used logically to control the rendering behavior of the web part.
There is already a default implementation of Render method.
We need not always override Render method for certain cases
like CreateChildControls method having the logic to add controls.
Render method can be overridden to render both the html stuff and ASP.NET web server controls

Render Control:

This method can be called inside the overridden Render method to render the ASP.NET web server controls
like button, textbox etc…

Render Contents:

RenderContents gives power to render the html streams directly inside the overridden Render method.
The RenderContents should be preceded by RenderBeginTag and the RenderContents should be followed RenderEndTag

Anunțuri

Lasă un răspuns

Completează mai jos detaliile tale sau dă clic pe un icon pentru a te autentifica:

Logo WordPress.com

Comentezi folosind contul tău WordPress.com. Dezautentificare / Schimbă )

Poză Twitter

Comentezi folosind contul tău Twitter. Dezautentificare / Schimbă )

Fotografie Facebook

Comentezi folosind contul tău Facebook. Dezautentificare / Schimbă )

Fotografie Google+

Comentezi folosind contul tău Google+. Dezautentificare / Schimbă )

Conectare la %s