Hallo List,
ich habe innerhalb der Codebehinddatei dynamisch einer Dropdownlist einen
SelectedIndexChanged Event hinzugef�gt und AutoPostback auf true gesetzt.
Leider wird der Event nicht gefeuert wenn ich die Dropdwonliste �ndere.
Woran kann das liegen?
QuellCode:
HTML :
<asp:DropDownList ID="ddlLocation" Runat="server"
OnLoad="GetLocationData"></asp:DropDownList>
CodeBehind:
protected void Repeater_ItemDataBound(object sender,RepeaterItemEventArgs e)
{
try
{
if(e.Item.ItemType == ListItemType.Item ||
e.Item.ItemType == ListItemType.AlternatingItem)
{
//
//if((DataTable)Session["actTaskData"]))
string _hierarchyLevel =
((DataTable)Session["actStockObjectData"]).Rows[e.Item.ItemIndex]["hierarchyLevel"].ToString();
System.Diagnostics.Debug.WriteLine("Level: " +
_hierarchyLevel);
if(_hierarchyLevel.Equals(Ebell.Const.HIER_LEVEL_STANDARD))
{
((DropDownList)e.Item.FindControl("ddlLocation")).Enabled=false;
((TextBox)e.Item.FindControl("txtbbuildingNumber")).Enabled=false;
((TextBox)e.Item.FindControl("txtbroomNumber")).Enabled=false;
((TextBox)e.Item.FindControl("txtbconnection")).Enabled=false;
((DropDownList)e.Item.FindControl("ddlCostCenter")).Enabled=false;
((TextBox)e.Item.FindControl("txtbdueDate")).Enabled=false;
}
else
if(_hierarchyLevel.Equals(Ebell.Const.HIER_LEVEL_SYSTEM))
{
//Wenn System dann diese Controls auf
AutoPostback true
//damit bei �nderungen hier diese
�berall automatisch �bernommen werden
((DropDownList)e.Item.FindControl("ddlLocation")).SelectedIndexChanged += new
System.EventHandler(SetDataInDataTable);
((DropDownList)e.Item.FindControl("ddlLocation")).AutoPostBack=true;
}
}
}
catch(Exception Exc)
{
//Logfile
Ebell.Logger.LogError(Exc);
}
}
_______________________________________________
Asp.net mailing list
[EMAIL PROTECTED]
http://www.glengamoi.com/mailman/listinfo/asp.net