473,748 Members | 3,107 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Mar 31 '06 #1
0 1170

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

Similar topics

4
5482
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 dropdownlist to the screen for selection. This continues until there are no children, and then it checks for a help article list based on that last selection and displays actual articles for display. Adding the controls and getting everything...
0
1235
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 must do this exactly!)
2
1698
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 textboxes and the dropdownlist) and lots more stuff on the page. When the user wants to save the page he'll click the save button. The server gets the postback but I can read out the filled in controls (in my control). The textboxes text = ""...
6
2271
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 the same method (aka delegate?). I use the Tag property within this method to determine what user action is taking place. Very simple: When adding toolbar button: tbButton.Click += new...
0
8987
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8826
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9534
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9316
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6793
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4597
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3303
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2777
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.