473,395 Members | 1,863 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,395 software developers and data experts.

ListBox1_SelectedIndexChanged

I am trying to redirect to a new page aftr selecting an item in a list box. There is a button n only aftr clicking the button , the listbox is visible.Then the item is selected.Can anybody help me achieving this.
The code i wrote is given below.
Thanks in advance....


private void ListBox1_SelectedIndexChanged(object sender, System.EventArgs e)
{
if(ListBox1.SelectedItem.Text.Equals("abc"))
Response.Redirect("Shome.aspx");
}
Sep 20 '07 #1
4 4732
Whats the problem are you facing ? giving any error ?
Sep 20 '07 #2
Whats the problem are you facing ? giving any error ?
Its not giving an error; but not redirecting to the new page.
Sep 20 '07 #3
ammoos
100 100+
Please check that the "AutoPostBack" property of the listbox is "true"

If it is "false: then set the property to "true"

AutoPostBack="True"
Sep 20 '07 #4
dip_developer
648 Expert 512MB
I am trying to redirect to a new page aftr selecting an item in a list box. There is a button n only aftr clicking the button , the listbox is visible.Then the item is selected.Can anybody help me achieving this.
The code i wrote is given below.
Thanks in advance....


private void ListBox1_SelectedIndexChanged(object sender, System.EventArgs e)
{
if(ListBox1.SelectedItem.Text.Equals("abc"))
Response.Redirect("Shome.aspx");
}
nothing wrong in your code.....Just check for the AutoPostBack property of your listbox...it must be set to True
Sep 20 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Kun | last post by:
Dear all, Can we avoid listBox1_SelectedIndexChanged from fire? My problem is during form load I fill listbox with employee name. In listBox1_SelectedIndexChanged event detail information of...
4
by: news | last post by:
Not really sure if this is a javascript problem or C# - sorry if in wrong place. Modal Forms Question in Web Application I have two web forms: Form1 and Form2 Form1 calls Form2 using...
0
by: L.Peter | last post by:
Dear Group, I am doing Drag and Drop function and see this problem if I select 3 from listBox1 and drag to listBox2, the value in listBox1 is not updated, even I move (or use up and down keyboard)...
7
by: GTi | last post by:
In Win32 I have a function that opens several Dialogs and put the window handle in a listbox (together with a string): HWND hWnd = CreateDialogParam(...) LB_SETITEMDATA, index, (LPARAM)hWnd); ...
1
by: Daniel | last post by:
hi, I had an asp:listbox, and everytime i click item inside, the bar automatically go to the top, is there any way to keep the scroll position? I turn on the smartNavigation, it still doesn't...
5
by: Niggy | last post by:
I think I'm missing an execute command here. Please help. Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles...
6
by: rodchar | last post by:
Hey all, I was wondering if I wanted to run the listbox1_SelectedIndexChanged by calling it in my code(without actually clicking on the screen), how can I do this? thanks, rodchar
5
by: Dave | last post by:
Hi All, I have a windows form that contains 2 listboxes and 2 buttons. The listbox on the right is populated by a database routine (This is the easy part). The listbox on the left is populated...
5
by: hmkaddoura | last post by:
Hi all, I have a question... I'm creating tabs programmatically using vb.net . in each tab that is created there is listbox, and 4buttons (also added by coding). when i change the listbox...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...
0
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...

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.