473,587 Members | 2,258 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

selectedindexch anged and user controls

Has anyone experienced any problems with their selectedindexch anged not
firing when there are user controls present on the page? I have 4 controls
on a page and only once I remove all 4 does my dropdownbox
selectedindexch anged work.

Any ideas?
Nov 18 '05 #1
2 1410
Hi Brent,

That sounds really weird. It would help if you could reduce the non-working
sample to minimum size and post it for all to see what may be wrong.

--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Looking for insights on ASP.NET? Read my blog:
http://obies.com/vga/blog.aspx

To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
"Brent Burkart" <Br***********@ wvmb.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Has anyone experienced any problems with their selectedindexch anged not
firing when there are user controls present on the page? I have 4 controls on a page and only once I remove all 4 does my dropdownbox
selectedindexch anged work.

Any ideas?

Nov 18 '05 #2
Thanks, here is the code behind my aspx and the user control. All of my user
controls are pretty much the same. They are just navigational links.

'CODE BEHIND

Imports System.Data

Public Class ProductDetailsP age

Inherits System.Web.UI.P age

Protected WithEvents ModelName As System.Web.UI.W ebControls.Labe l

Protected WithEvents ProductImage As System.Web.UI.W ebControls.Imag e

Protected WithEvents ModelNumber As System.Web.UI.W ebControls.Labe l

Protected WithEvents addToCart As System.Web.UI.W ebControls.Hype rLink

Protected WithEvents desc As System.Web.UI.W ebControls.Labe l

Protected ReviewList As C_ReviewList

Protected WithEvents Price3 As System.Web.UI.W ebControls.Labe l

Protected WithEvents Price1 As System.Web.UI.W ebControls.Labe l

Protected WithEvents Price2 As System.Web.UI.W ebControls.Labe l

Protected WithEvents infoDrp As System.Web.UI.W ebControls.Drop DownList

Protected AlsoBoughtList As C_AlsoBought

Dim ProductID2 As Integer

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load

' Obtain ProductID from QueryString

Dim ProductID As Integer = CInt(Request.Pa rams("ProductID "))

ProductID2 = ProductID

' Obtain Product Details

Dim products As ProductsDB = New ProductsDB()
Dim myproductinfo As SqlClient.SqlDa taReader =
products.GetPro ductInfo(Produc tID)
If myproductinfo.R ead Then
infoDrp.DataSou rce = myproductinfo

infoDrp.DataTex tField = "Spec"

infoDrp.DataVal ueField = "SpecID"

infoDrp.DataBin d()

infoDrp.Items.I nsert(0, New ListItem("Pleas e Choose", "0"))

infoDrp.Selecte dIndex = 0
End If


End Sub

Private Sub infoDrp_Selecte dIndexChanged(B yVal sender As System.Object,
ByVal e As System.EventArg s) Handles infoDrp.Selecte dIndexChanged

addToCart.Navig ateUrl = "AddToCart.aspx ?ProductID=" & ProductID2 &
"&SpecID=" & infoDrp.Selecte dItem.Value

End Sub

End Class

'USER CONTROL CODE BEHIND

Public MustInherit Class C_Header

Inherits System.Web.UI.U serControl

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load

End Sub

End Class

"Victor Garcia Aprea [MVP]" <vg*@NOobiesSPA M.com> wrote in message
news:eF******** ******@TK2MSFTN GP11.phx.gbl...
Hi Brent,

That sounds really weird. It would help if you could reduce the non-working sample to minimum size and post it for all to see what may be wrong.

--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Looking for insights on ASP.NET? Read my blog:
http://obies.com/vga/blog.aspx

To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
"Brent Burkart" <Br***********@ wvmb.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Has anyone experienced any problems with their selectedindexch anged not
firing when there are user controls present on the page? I have 4

controls
on a page and only once I remove all 4 does my dropdownbox
selectedindexch anged work.

Any ideas?


Nov 18 '05 #3

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

Similar topics

1
9085
by: Donal | last post by:
I have 3 related dropdowns. When the 1st is changed, the 2nd is updated, and when the 2nd is changed, the 3rd is updated. When i change the 1st dropdown (sites), the SelectedIndexChanged fires and the 2nd dropdown (spaces) is updated. However, 'spaces' no longer has a SelectedIndexChanged event. Where did it go to? If I change 'spaces'...
0
5407
by: PeacError | last post by:
Using Microsoft Visual Studio .NET 2003, Visual C# .NET 1.1: I apologize if this question has been addressed elsewhere, but I could not find a reference to it in the search engine for this board. I have a form that contains a ListView and a GroupBox control. The GroupBox control itself contains several TextBox Controls. I have...
1
8373
by: Edward | last post by:
I am having a terrible time getting anything useful out of a listbox on my web form. I am populating it with the results from Postcode lookup software, and it is showing the results fine. What I want to do is to allow the user to click on the row that corresponds to the correct address, and have the code behind populate the form's...
7
6173
by: Daniel | last post by:
Is there any other way can override this event, like javascript onchange added to the attribute of this dropdownlist? Thanks
0
1271
by: bnolingberg | last post by:
Hi all. I've been stuck on this problem for a while (I'm a newbie). I have a listbox with several collection objects, some of them being identical. When one of the collection items is selected in the listbox, the values of that collection item can be set but if an identical collection item is also present in the listbox, its variables are...
3
2619
by: Alec MacLean | last post by:
Hi, I have a couple of win forms where I am editing values that are stored in a SQL database. I'm using the listbox control to hold the data object each form interacts with. Each object is defined by my own classes. On the first form, I use an approach to reduce the number of database calls. This essentially consists of :
2
3287
by: jnoody | last post by:
The problem I am having is with the SelectedIndexChanged event not always firing or the SelectedIndex property not being correct when the event does fire. The code is below, but here are some details first. The DropDownList is actually a custom control called DropDownListWithCommandEvent that inherits from DropDownList. The reason I have...
11
36945
by: J055 | last post by:
Hi I have a dropdown control which is constructed in another dropdown control SelectedIndexChanged event protected void ddlParamType_SelectedIndexChanged(object sender, EventArgs e) { // some other code DropDownList ddlGroups = new DropDownList(); ddlGroups.SelectedIndexChanged += new
5
2178
by: revbart | last post by:
Yep, that's me. I'll bet I've read a hundred articles somewhere or another, but I just can't get the thing to work. I'm working on a custom solution. One of the major UIs includes a calendar-style presentation. The navigation controls at the top of the calendar include four LinkButton controls (prevYear, prevMonth, nextMonth, nextYear) and two...
0
7915
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...
0
7843
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...
0
8205
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. ...
0
8339
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5392
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...
0
3840
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...
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1185
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.