HighTechTalks DotNet Forums  

Custom Control - LoadPostData Problem

ASP.net Building Controls microsoft.public.dotnet.framework.aspnet.buildingcontrols


Discuss Custom Control - LoadPostData Problem in the ASP.net Building Controls forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default Custom Control - LoadPostData Problem - 12-16-2003 , 10:56 AM






Hi, I'm having a problem with a Custom Control that I've been working
on, and could use some help.

I have a custom built content editing site that I am working on and
have written several custom controls for. They all work fine when I
add the controls directly into an ASP.NET page (<control:name />), but
I need to render these controls dynamically into the page depending on
user navigation. The problem is that when these controls are
rendered, after the user chooses which page he wants to work on and
edits some data, the LoadPostData event is not firing for this
control. Like I said if I load this control directly into an ASP.NET
page then it's fine. Here is a sample of how the controls are
rendered:

Protected WithEvents psContentEditor as ctrlEditContent

Public Sub ddlEditor_Change(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles ddlEditor.SelectedIndexChanged
Try
Session("EditorId") = ddlEditor.SelectedItem.Value

'Render the site
LoadEditor()
Catch errEx As Exception
LogError(errEx)
End Try
End Sub

Public Sub LoadEditor()
Try
Select Case Session("EditorId")
Case 1
'ctrlCurrentEditor = New ctrlEditContent()
psContentEditor = New ctrlEditContent()
psContentEditor.EnableViewState = True
psContentEditor.ID = "ctrlEditor"
'...load additional parameters here
myPlaceHolder.Controls.Add(psContentEditor)

Catch errEx as Exception
LogError(errEx)
End Try

End Sub

I have controls that are rendered similarly on other sites without any
issues at all. But for some reason this site doesn't want to run the
LoadPostData event for these controls.

Any help would be appreciated.

Thanks,
Frank

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.