DROPDOWNLIST SELECTEDINDEXCHANGED

J

Jose Fernandez

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;

}
 
M

Marcos Mellibovsky

tenes agregada la rutina como controladora del evento?

Mes.SelectedIndexChanged += Mes_SelectedIndexChanged


--
Saludos
Marcos Mellibovsky
MCAD - MCSD - MCSE - MCDBA
Cordoba - Argentina
"Jose Fernandez" <[email protected]> escribió en el mensaje 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;

}
 
J

Jose Fernandez

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


--
Saludos
Marcos Mellibovsky
MCAD - MCSD - MCSE - MCDBA
Cordoba - Argentina
"Jose Fernandez" <[email protected]> escribió en el mensaje
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;
}
 
J

Jose Fernandez

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 (e-mail address removed)
 
J

Jose Fernandez

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,592
Members
45,103
Latest member
VinaykumarnNevatia
Top