F
Frank Seibel
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
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