WebPart Question

P

Parag C Mehta

Hi,

We are exploring the new possiblities in ASP.NET v2.0.

I want to have a page, in this page I have one WebPartManager
3 zones and I want to dynamically add WebParts to 3 zones.

I chose Page_InitComplete event (as explained in PDC 05) to load
UserControls dynamically into WebParts and Add it to Manager.

I just tried putting a Calendar Control on the UserControl and it
looses the values on postback :( . Change in dates doesn't work
(in fact control is as good as created a fresh).

How can I stop this behavious ???
 
C

Cowboy \(Gregory A. Beamer\)

I would step through the code and see where you are setting values. Most
likely that code is hit prior to your attempting to retrieve values. I have
seen this happen a lot in Page_Load, both in 1.x and 2.0.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***********************************************
Think Outside the Box!
***********************************************
 
P

Parag C Mehta

Hi Gregory,

It's not Page_Load because I do in Page_InitComplete. In Pre_Init I enabled
the personalization on webPart.

Here is the basic synopsis :

=> Pre_Init of the Page enable personalization
=> Page_InitComplete : Load GenericWebParts dynamically from UserControl.

I tried putting it in Page_Init, but same result. And if I load control by
checking the postback,
then control disappears altogether! Which I assume is right. But what
perplexes me is that
user control values aren't serialized at all.

Best Regards,
Parag.


Cowboy (Gregory A. Beamer) said:
I would step through the code and see where you are setting values. Most
likely that code is hit prior to your attempting to retrieve values. I have
seen this happen a lot in Page_Load, both in 1.x and 2.0.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***********************************************
Think Outside the Box!
***********************************************
 

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,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top