Hey there. I have a user control on an aspx page that displays data
based on a query (handled by another user control also on the page).
I've noticed that the first time I navigate to the page with the user
control, I can click on links, buttons etc on the user control and
navigate around. On subsequent postbacks, say when a user submits a
new query, the buttons and links on the user control are
"un-clickable". You get no click sound or functionality from the
buttons. I'll include the code for the container page below. What
could be going on here? By the way, the user control I'm complaining
about is called "viewQuesti on".
TIA,
campwes
Public Class dmmQuestion
Inherits System.Web.UI.P age
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()
End Sub
Public WithEvents JumpToQuestionN umber1 As JumpToQuestionN umber
Protected WithEvents ViewQuestion1 As viewQuestion
Protected WithEvents dmmTopNav1 As dmmTopNav
Protected WithEvents lblChangesSaved As
System.Web.UI.W ebControls.Labe l
Protected WithEvents phEvidMgmt As
System.Web.UI.W ebControls.Plac eHolder
Protected WithEvents EvidMgmt1 As EvidenceManagem ent
Protected WithEvents dmmSideNav1 As dmmSideNav
Protected WithEvents dmmFooter1 As dmmFooter
Protected WithEvents phJump As
System.Web.UI.W ebControls.Plac eHolder
Protected WithEvents phViewQuestionC tl As
System.Web.UI.W ebControls.Plac eHolder
Protected WithEvents phSaveQuestionS tatusCtl As
System.Web.UI.W ebControls.Plac eHolder
'NOTE: The following placeholder declaration is required by the Web
Form Designer.
'Do not delete or move it.
Private designerPlaceho lderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeCompo nent()
End Sub
#End Region
Public sourcePage As dmm
Public newUCText As String
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
'Put user code to initialize the page here
'Dim qLock As DMMLockUtil
'qLock.LOCK_EXP IRATION_MIN()
If Not IsPostBack Then
sourcePage = CType(Context.H andler, dmm)
ViewQuestion1 =
DirectCast(Load Control("UserCo ntrols\viewQues tion.ascx"), viewQuestion)
phViewQuestionC tl.Controls.Add (ViewQuestion1)
ViewQuestion1.j umpCtlText = sourcePage.newU CText.ToString
ViewQuestion1.b ind_dlQuestion( )
Else
ViewQuestion1 =
DirectCast(Load Control("UserCo ntrols\viewQues tion.ascx"), viewQuestion)
phViewQuestionC tl.Controls.Add (ViewQuestion1)
ViewQuestion1.V isible = False
End If
' Load the JumpToQuestion user control for the main page
JumpToQuestionN umber1 =
DirectCast(Load Control("UserCo ntrols\JumpToQu estionNumber.as cx"),
JumpToQuestionN umber)
phJump.Controls .Add(JumpToQues tionNumber1)
' Persist the question number from the main to the question
page
'JumpToQuestion Number1.txtQues tionNumber.Text =
ViewQuestion1.j umpCtlText
' Page level event handler
AddHandler JumpToQuestionN umber1.JumpToQu estionNumberEve nt,
AddressOf TextBoxChanged
' Load the EvidenceManagem ent user control
EvidMgmt1 =
DirectCast(Load Control("UserCo ntrols\Evidence Management.ascx "),
EvidenceManagem ent)
phEvidMgmt.Cont rols.Add(EvidMg mt1)
EvidMgmt1.Asses smentID = CStr(2)
EvidMgmt1.Quest ionID = CStr(4)
End Sub
Public Sub TextBoxChanged( ByVal Sender As Object, ByVal e As
JumpToQuestionN umberEventArgs)
newUCText = e.UnvalidatedQu estionNumber
ViewQuestion1 =
DirectCast(Load Control("UserCo ntrols\viewQues tion.ascx"), viewQuestion)
phViewQuestionC tl.Controls.Add (ViewQuestion1)
ViewQuestion1.j umpCtlText = newUCText
ViewQuestion1.b ind_dlQuestion( )
End Sub
End Class