[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

alex Gongora

1/14/2003 12:57:00 AM

Hi...

i use a dropdown list box, i add items on run, but the
event selectedindexchaned don't responde...but if i
precharge the item collection the event
selectedindexchanged, it works fine

some can tell me why??, and what I need to do so that it
works well, when I add items on run?
1 Answer

(Patrick C. Cole (MS))

1/14/2003 6:43:00 PM

0

Alex,

Here is the code I used to populate and demonstrate the
SelectedIndexChanged event:

private void Page_Load(object sender, System.EventArgs e)
{
if(!IsPostBack)
{
DropDownList1.Items.Clear();
DropDownList1.Items.Add("Alpha");
DropDownList1.Items.Add("Beta");
}
}

private void DropDownList1_SelectedIndexChanged(object sender,
System.EventArgs e)
{
Response.Write(DropDownList1.SelectedItem.Text.ToString());
}

I set the DropDownList AutoPostBack to TRUE as well.

Let me know if this helps resovle the issue.

Patrick Cole
Microsoft Developer Communities

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2002 Microsoft Corporation. All rights
reserved.
--------------------
| Content-Class: urn:content-classes:message
| From: "alex Gongora" <agongora@hotmail.com>
| Sender: "alex Gongora" <agongora@hotmail.com>
| Subject: SelectedIndexChanged
| Date: Mon, 13 Jan 2003 15:57:10 -0800
| Lines: 9
| Message-ID: <43f401c2bb5f$7cbb92b0$d7f82ecf@TK2MSFTNGXA14>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcK7X3y73YCwjXmYTp+V1WiWRNQnDw==
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| Path: cpmsftngxa09
| Xref: cpmsftngxa09
microsoft.public.dotnet.framework.aspnet.webcontrols:8492
| NNTP-Posting-Host: TK2MSFTNGXA14 10.40.1.166
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
|
| Hi...
|
| i use a dropdown list box, i add items on run, but the
| event selectedindexchaned don't responde...but if i
| precharge the item collection the event
| selectedindexchanged, it works fine
|
| some can tell me why??, and what I need to do so that it
| works well, when I add items on run?
|