473,324 Members | 2,473 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Strange postback behavior of user controls

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 "viewQuestion".

TIA,

campwes

Public Class dmmQuestion
Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()

End Sub
Public WithEvents JumpToQuestionNumber1 As JumpToQuestionNumber
Protected WithEvents ViewQuestion1 As viewQuestion
Protected WithEvents dmmTopNav1 As dmmTopNav
Protected WithEvents lblChangesSaved As
System.Web.UI.WebControls.Label
Protected WithEvents phEvidMgmt As
System.Web.UI.WebControls.PlaceHolder
Protected WithEvents EvidMgmt1 As EvidenceManagement
Protected WithEvents dmmSideNav1 As dmmSideNav
Protected WithEvents dmmFooter1 As dmmFooter
Protected WithEvents phJump As
System.Web.UI.WebControls.PlaceHolder
Protected WithEvents phViewQuestionCtl As
System.Web.UI.WebControls.PlaceHolder
Protected WithEvents phSaveQuestionStatusCtl As
System.Web.UI.WebControls.PlaceHolder

'NOTE: The following placeholder declaration is required by the Web
Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()

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.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here

'Dim qLock As DMMLockUtil
'qLock.LOCK_EXPIRATION_MIN()

If Not IsPostBack Then
sourcePage = CType(Context.Handler, dmm)
ViewQuestion1 =
DirectCast(LoadControl("UserControls\viewQuestion. ascx"), viewQuestion)
phViewQuestionCtl.Controls.Add(ViewQuestion1)
ViewQuestion1.jumpCtlText = sourcePage.newUCText.ToString
ViewQuestion1.bind_dlQuestion()
Else
ViewQuestion1 =
DirectCast(LoadControl("UserControls\viewQuestion. ascx"), viewQuestion)
phViewQuestionCtl.Controls.Add(ViewQuestion1)
ViewQuestion1.Visible = False
End If

' Load the JumpToQuestion user control for the main page
JumpToQuestionNumber1 =
DirectCast(LoadControl("UserControls\JumpToQuestio nNumber.ascx"),
JumpToQuestionNumber)
phJump.Controls.Add(JumpToQuestionNumber1)

' Persist the question number from the main to the question
page
'JumpToQuestionNumber1.txtQuestionNumber.Text =
ViewQuestion1.jumpCtlText

' Page level event handler
AddHandler JumpToQuestionNumber1.JumpToQuestionNumberEvent,
AddressOf TextBoxChanged

' Load the EvidenceManagement user control
EvidMgmt1 =
DirectCast(LoadControl("UserControls\EvidenceManag ement.ascx"),
EvidenceManagement)
phEvidMgmt.Controls.Add(EvidMgmt1)
EvidMgmt1.AssessmentID = CStr(2)
EvidMgmt1.QuestionID = CStr(4)
End Sub

Public Sub TextBoxChanged(ByVal Sender As Object, ByVal e As
JumpToQuestionNumberEventArgs)
newUCText = e.UnvalidatedQuestionNumber
ViewQuestion1 =
DirectCast(LoadControl("UserControls\viewQuestion. ascx"), viewQuestion)
phViewQuestionCtl.Controls.Add(ViewQuestion1)
ViewQuestion1.jumpCtlText = newUCText
ViewQuestion1.bind_dlQuestion()
End Sub
End Class

Mar 31 '06 #1
0 1152

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: DotNetJunky | last post by:
I have built a control that runs an on-line help system. Depending on the category you selected via dropdownlist, it goes out and gets the child subcategories, and if there are any, adds a new...
0
by: Dot net work | last post by:
Hi, Make up a very simple project as follows: 1 aspx form 3 web user controls (referred to as A, B, and C) "A" web user control: Put 1 textbox and 1 button on this web user control. (You...
2
by: Pipo | last post by:
Nobody knows how to get the values provided in the client can be read in the user-control? If have made a Web Custom Control with 2 textboxes and 1 dropdownlist. The user fills in my control (the...
6
by: Joseph Geretz | last post by:
Writing an Outlook AddIn with C#. For the user interface within Outlook I'm adding matching pairs of Toolbar buttons and Menu items. All of the buttons and menu items are wired up to send events to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.