Amigo Jaullo ya esta listo
Por fin logre lo que quería, esto se hace con Updatepanel de ajax, pero tenia un error y era que no colocaba los texboxs y los botones dentro de un UpdatePanel.
Si tienes un DDL dentro de UpdatePanel y quieres esconder un control X, al control X debes colocarlo también dentro de un UpdatePanel.Esto me fue útil para hacer los DDL en cascada
Saludos
HTML
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
</div>
<div id="div1" style="z-index: 101; left: 267px; width: 187px; position: absolute;
top: 34px; height: 63px">
<asp:UpdatePanel ID="UpdatePanel4" runat="server">
<ContentTemplate>
<div style="z-index: 101; left: -225px; width: 172px; position: absolute; top: 145px;
height: 106px">
<asp:TextBox ID="txt1" runat="server" Visible="False"></asp:TextBox><br />
<asp:TextBox ID="txt2" runat="server" Visible="False"></asp:TextBox><br />
<asp:Button ID="bt1" runat="server" OnClick="bt1_Click" Text="act" Visible="False" /><br />
<asp:Button ID="bt2" runat="server" Text="can" Visible="False" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:DropDownList ID="ddlpais" runat="server" AutoPostBack="true" AppendDataBoundItems="True" OnSelectedIndexChanged="ddlpais_SelectedIndexChang ed">
</asp:DropDownList>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddlpais" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
</div>
<div id="div2" style="z-index: 102; left: 266px; width: 189px; position: absolute;
top: 150px; height: 78px">
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<asp:DropDownList ID="ddlregion" runat="server" AutoPostBack="true" AppendDataBoundItems="True" OnSelectedIndexChanged="ddlregion_SelectedIndexCha nged" Width="108px">
<asp:ListItem>Select</asp:ListItem>
</asp:DropDownList>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddlregion" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
</div>
<div id="div3" style="z-index: 103; left: 275px; width: 182px; position: absolute;
top: 262px; height: 100px">
<asp:UpdatePanel ID="UpdatePanel3" runat="server">
<ContentTemplate>
<asp:DropDownList ID="ddlclte" runat="server" AutoPostBack="true" AppendDataBoundItems="True" OnSelectedIndexChanged="ddlclte_SelectedIndexChang ed" Width="106px">
<asp:ListItem>Select</asp:ListItem>
</asp:DropDownList>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddlclte" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
</div>
</form>
codigo VB
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
ddlpais.DataSource = customer.Fetchpais
ddlpais.Items.Add("Select")
ddlpais.DataValueField = "codpais"
ddlpais.DataTextField = "descripcionpais"
ddlpais.DataBind()
End If
End Sub
Protected Sub ddlpais_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
ddlregion.Items.Clear()
ddlregion.Items.Add("Select")
ddlclte.Items.Clear()
ddlclte.Items.Add("Select")
ddlregion.Items.Add("Agregar Subcursal")
ddlregion.Visible = True
ddlregion.DataSource = customer.Fetchregion(ddlpais.SelectedItem.Value)
ddlregion.DataValueField = "region"
ddlregion.DataTextField = "descripcion"
ddlregion.DataBind()
End Sub
Protected Sub ddlregion_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
If ddlregion.SelectedItem.Text = "Agregar Subcursal" Then
txt1.Visible = True
txt2.Visible = True
bt1.Visible = True
bt2.Visible = True
ddlregion.Visible = False
Else
ddlclte.Items.Clear()
ddlclte.Items.Add("Select")
ddlclte.Items.Add("Agregar Cliente")
ddlclte.DataSource = customer.Fetchclte(ddlpais.SelectedItem.Value, ddlregion.SelectedItem.Value)
ddlclte.DataValueField = "codclte"
ddlclte.DataTextField = "nombre"
ddlclte.DataBind()
End If
End Sub
Protected Sub bt1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
txt1.Visible = False
txt2.Visible = False
bt1.Visible = False
bt2.Visible = False
ddlregion.Visible = True
ddlclte.Visible = True
End Sub
Protected Sub ddlclte_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
If ddlclte.SelectedItem.Text = "Agregar Cliente" Then
txt1.Visible = True
txt2.Visible = True
bt1.Visible = True
bt2.Visible = True
ddlclte.Visible = False
End If
End Sub
:apla uso: