473,608 Members | 2,410 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Raising events with a tabstrip

Hi,

I've created a webusercontrol that contains a tabstrip
(Microsoft.Web. UI.WebControls. TabStrip.
I want to raise the event when the selected index of the tabstrip changes.
I wrote the following code :

Public Event TabIndexChanged (ByVal intSelectedInde x As Int16)

Private Sub TabStrip1_onSel ectedIndexChang e(ByVal sender As System.Object,
ByVal e As System.EventArg s) Handles TabStrip1.Selec tedIndexChange
Dim intSelIndex As Integer = (CType(sender,
Microsoft.Web.U I.WebControls.T abStrip)).Selec tedIndex
RaiseEvent TabIndexChanged (intSelIndex)
End Sub

The problem is that when I check the value of intSelIndex it always is -1.
What did I do wrong?
Thanks in advance.
Nov 19 '05 #1
2 1419
Hi Bart
write ur code inside if page.IsPostBack =false
"Bart Schelkens" wrote:
Hi,

I've created a webusercontrol that contains a tabstrip
(Microsoft.Web. UI.WebControls. TabStrip.
I want to raise the event when the selected index of the tabstrip changes.
I wrote the following code :

Public Event TabIndexChanged (ByVal intSelectedInde x As Int16)

Private Sub TabStrip1_onSel ectedIndexChang e(ByVal sender As System.Object,
ByVal e As System.EventArg s) Handles TabStrip1.Selec tedIndexChange
Dim intSelIndex As Integer = (CType(sender,
Microsoft.Web.U I.WebControls.T abStrip)).Selec tedIndex
RaiseEvent TabIndexChanged (intSelIndex)
End Sub

The problem is that when I check the value of intSelIndex it always is -1.
What did I do wrong?
Thanks in advance.

Nov 19 '05 #2
Sara,

the tabstrip needs to perform the autopostback or the event isn't triggered.
So I think that's my problem.

But putting the code inside if page.ispostback = false doesn't work either.
"sara" <sa**@discussio ns.microsoft.co m> schreef in bericht
news:1C******** *************** ***********@mic rosoft.com...
Hi Bart
write ur code inside if page.IsPostBack =false
"Bart Schelkens" wrote:
Hi,

I've created a webusercontrol that contains a tabstrip
(Microsoft.Web. UI.WebControls. TabStrip.
I want to raise the event when the selected index of the tabstrip
changes.
I wrote the following code :

Public Event TabIndexChanged (ByVal intSelectedInde x As Int16)

Private Sub TabStrip1_onSel ectedIndexChang e(ByVal sender As
System.Object,
ByVal e As System.EventArg s) Handles TabStrip1.Selec tedIndexChange
Dim intSelIndex As Integer = (CType(sender,
Microsoft.Web.U I.WebControls.T abStrip)).Selec tedIndex
RaiseEvent TabIndexChanged (intSelIndex)
End Sub

The problem is that when I check the value of intSelIndex it always
is -1.
What did I do wrong?
Thanks in advance.

Nov 19 '05 #3

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

Similar topics

4
2085
by: serge calderara | last post by:
Dear all, I have a class wich is raising events as normally it should do. having a form in the same assembly wich is catching those events works fne. Raise events gets catch normaly within the form and I can process what I want based on them. If I try to catch raised events by this class but within a form located in a different assembly, I am not able to
6
2853
by: Dan | last post by:
I've created a pocketpc app which has a startup form containing a listview. The form creates an object which in turn creates a System.Threading.Timer. It keeps track of the Timer state using a TimerState object similar to the example in the System.Threading.Timer documentation. The method which handles the timer events, among other things, periodically calls a method in this TimerState object which raises an event to the startup form,...
0
1721
by: Greg Park | last post by:
I have many user controls loading into a web page using Page.LoadControl However, I'm unable to figure out how to raise an event when a button is click or a check box is checked. I can have upto a hundred user controls on a single page and AutoPostBack isn't an option. I have no problem with raising events when an user control is dropped on the aspx page.
1
1119
by: Vannela | last post by:
What are the events associated with TabStrip IE Web Control? Where can i find them? Thank you.
0
1441
by: Joe Campbell | last post by:
I am encountering a problem raising WMI events from an asp.net application. The error received (as captured in the event log) is as follows: System.Runtime.InteropServices.COMException (0x80041003): Exception from HRESULT: 0x80041003. at Microsoft.EnterpriseInstrumentation.EventSinks.WmiEventSink ..Write(Object eventToRaise) at
4
1588
by: Dave A | last post by:
I am developing a somewhat complex component at the moment and coincidently I am also reading the Framework Design Guidelines book. After reading the section about event raising I have re-written the way my component raises events to follow the Framework Design Guides verbatim; ie (object sender, EventArgs (or some subclass there of) e). The thing that was not explained is why should I need to cast the sender to 'object' when I know...
2
1690
by: Gman | last post by:
Hi, I have created a usercontrol, a grid control essentially. Within it I have a class: clsGridRecord. I have coded the events such that when a user clicks on the grid, say, the events occur on the parent form. This is fine. The problem occurs when I want to raise an event for a user clicking on one of the clsRecords which are on the grid. So I've placed: Public Event GridRecordClicked(ByVal rec As clsGridRecord,
0
1090
by: Ashish | last post by:
HI all, I have been battling with this problem with some time now, now iam out of ideas what to do basically iam planning a tab control in which page developers can define tab abd tabelements on the page, and i can render a table with one row being link buttons and second row with tabelements.. tha markup of the control looks like <uc:TabStrip ID="tbMatrixProduct" runat="server">
1
7153
by: xpnctoc | last post by:
Here's the 30,000-ft. view: I wrapped an asp:Menu control in an ascx control. When I try to dynamically populate the menu in the ascx control, the items appear, but clicking on them fails to trigger the MenuItemClick event handler. However, if I statically declare the menu items in the .ascx page, everything is fine. Any ideas? Here's the details: My ascx page: <%@ Control Language="VB" AutoEventWireup="false"...
0
8067
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
8010
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
8483
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8157
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,...
0
6820
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
3967
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...
0
4030
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1607
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1336
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.