Webpart - web user control - page_load firing as postback

R

ryan.mclean

Hello all,

Here is my problem: I made a simple web project that uses they new
webparts. On my page, I have a DeclarativeCatalogPart that contains
references to several ascx files. I put my page into catalog mode, and
put the selected controls (ascx) into a webzone and viola, the controls
are there, but the user control page_load thinks it's a postback. So I
end up have to reload my databings on every postback. Does that make
sense? There is probably a correct way to deal with this and if anybody
has any ideas, I would appreciate it.

Thank you for your help,
Ryan
 
R

ryan.mclean

Not sure if my question was worded incorrectly, but here is the best
answer I came up with . . .

If ((Page.IsPostBack _
AndAlso (Request.Form("__EVENTARGUMENT") = "add" _
And Request.Form("__EVENTTARGET").IndexOf("czMain")
Or Not Page.IsPostBack) _
) Then

' load control
End If

Notice the __EVENTARGUMENT is add, and the __EVENTTARGET contains the
id of your catalog.

Thanks,
Ryan
 

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,997
Messages
2,570,240
Members
46,828
Latest member
LauraCastr

Latest Threads

Top