Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Controls / May 2005

Tip: Looking for answers? Try searching our database.

DROPDOWNLIST SELECTEDINDEXCHANGED

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jose Fernandez - 30 May 2005 20:22 GMT
Hola

Estoy haciendo un usercontrol que tiene un dropdownlist (id=Mes) y no me ejecuta el evento Mes_SelectedIndexChanged(object sender, EventArgs e)...

AutoEventWireUp es TRUE y tambien el autopostback...

alguien sabe que puede estar pasando?
aqui van los codigos...

<%@ Control Language="c#" AutoEventWireup="true" Codebehind="FechaPicker.ascx.cs" Inherits="Voluntarios.controls.FechaPicker" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
<asp:DropDownList id="Dia" runat="server"></asp:DropDownList>
<asp:DropDownList id="Mes" AutoPostBack=True runat="server"></asp:DropDownList>
<asp:DropDownList id="Ano" AutoPostBack=True runat="server"></asp:DropDownList>
==============================================================void Ano_SelectedIndexChanged(object sender, System.EventArgs e)

{

DateTime xFecha=new DateTime(Convert.ToInt32(Ano.SelectedItem.Value),MyDate.Month,MyDate.Day);

MyDate=xFecha;

}

private void Mes_SelectedIndexChanged(object sender, System.EventArgs e)

{

DateTime xFecha=new DateTime(MyDate.Year,Convert.ToInt32(Mes.SelectedItem.Value),MyDate.Day);

MyDate=xFecha;

}
Marcos Mellibovsky - 31 May 2005 04:29 GMT
tenes agregada la rutina como controladora del evento?

Mes.SelectedIndexChanged += Mes_SelectedIndexChanged

Signature

Saludos
Marcos Mellibovsky
MCAD - MCSD - MCSE - MCDBA
Cordoba - Argentina

 Hola

 Estoy haciendo un usercontrol que tiene un dropdownlist (id=Mes) y no me ejecuta el evento Mes_SelectedIndexChanged(object sender, EventArgs e)...

 AutoEventWireUp es TRUE y tambien el autopostback...

 alguien sabe que puede estar pasando?
 aqui van los codigos...
 
 <%@ Control Language="c#" AutoEventWireup="true" Codebehind="FechaPicker.ascx.cs" Inherits="Voluntarios.controls.FechaPicker" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
 <asp:DropDownList id="Dia" runat="server"></asp:DropDownList>
 <asp:DropDownList id="Mes" AutoPostBack=True runat="server"></asp:DropDownList>
 <asp:DropDownList id="Ano" AutoPostBack=True runat="server"></asp:DropDownList>
 ==============================================================  void Ano_SelectedIndexChanged(object sender, System.EventArgs e)

 {

 DateTime xFecha=new DateTime(Convert.ToInt32(Ano.SelectedItem.Value),MyDate.Month,MyDate.Day);

 MyDate=xFecha;

 }

 private void Mes_SelectedIndexChanged(object sender, System.EventArgs e)

 {

 DateTime xFecha=new DateTime(MyDate.Year,Convert.ToInt32(Mes.SelectedItem.Value),MyDate.Day);

 MyDate=xFecha;

 }

 
Jose Fernandez - 31 May 2005 16:21 GMT
Si, lo tengo....

acabo de hacer una paginita tonta, con un usercontrol embedded y en el
usercontrol un dropdown con un textbox y el evento selectedindex y me
funciona....
ahora si que no entiendo nada.
AYUDA POR FAVORRRRRR

private void InitializeComponent()
{
this.Mes.SelectedIndexChanged += new
System.EventHandler(this.Mes_SelectedIndexChanged);
this.Ano.SelectedIndexChanged += new
System.EventHandler(this.Ano_SelectedIndexChanged);
this.Load += new System.EventHandler(this.Page_Load);
}

tenes agregada la rutina como controladora del evento?

Mes.SelectedIndexChanged += Mes_SelectedIndexChanged

Signature

Saludos
Marcos Mellibovsky
MCAD - MCSD - MCSE - MCDBA
Cordoba - Argentina
"Jose Fernandez" <ppcuban@hotmail.com> escribió en el mensaje
news:O%236VhzUZFHA.1088@TK2MSFTNGP14.phx.gbl...
Hola

Estoy haciendo un usercontrol que tiene un dropdownlist (id=Mes) y no me
ejecuta el evento Mes_SelectedIndexChanged(object sender, EventArgs e)...

AutoEventWireUp es TRUE y tambien el autopostback...

alguien sabe que puede estar pasando?
aqui van los codigos...

<%@ Control Language="c#" AutoEventWireup="true"
Codebehind="FechaPicker.ascx.cs" Inherits="Voluntarios.controls.FechaPicker"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
<asp:DropDownList id="Dia" runat="server"></asp:DropDownList>
<asp:DropDownList id="Mes" AutoPostBack=True
runat="server"></asp:DropDownList>
<asp:DropDownList id="Ano" AutoPostBack=True
runat="server"></asp:DropDownList>
===============================================================
void Ano_SelectedIndexChanged(object sender, System.EventArgs e)
{
DateTime xFecha=new
DateTime(Convert.ToInt32(Ano.SelectedItem.Value),MyDate.Month,MyDate.Day);
MyDate=xFecha;
}
private void Mes_SelectedIndexChanged(object sender, System.EventArgs e)
{
DateTime xFecha=new
DateTime(MyDate.Year,Convert.ToInt32(Mes.SelectedItem.Value),MyDate.Day);
MyDate=xFecha;
}

Jose Fernandez - 31 May 2005 16:52 GMT
Realmente estoy desesperado. necesito resolver este problema pues tengo solo
esta semana para entregar este trabajo.
los que quieran el codigo fuente completo de estas paginas, escribanme a mi
correo y se los mando.
aprecio muchisimo cualquier ayuda que puedan darme.
Jose ppcuban@hotmail.com

> Si, lo tengo....
>
[quoted text clipped - 16 lines]
>
> Mes.SelectedIndexChanged += Mes_SelectedIndexChanged
Jose Fernandez - 31 May 2005 18:31 GMT
YA
la solucion esta aqui....
El problema era que en esa misma pagina estaba otro usercontrol que tenia un
codigo html y dentro habia un form (del antiguo ASP) y por lo tanto no
permitia hacer postback a la pagina. Por eso era que yo usaba el mismo
usercontrol en otras paginas y me pinchaba bien sin problemas.....
Les agradezco de todos modos la atencion.
un abrazo

> Realmente estoy desesperado. necesito resolver este problema pues tengo
> solo esta semana para entregar este trabajo.
[quoted text clipped - 23 lines]
>>
>> Mes.SelectedIndexChanged += Mes_SelectedIndexChanged

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.