Tengo el siguiente codigo hecho en Dream + ASP.Net .....
Código:
pero cuando lo ejecuto y cambio el valor del dropdownlist se ve que refresca la pantalla y pero no me mantiene los datos que yo escogi..... me muestra los valores iniciales......Que me falta en el codigo?<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %> <%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls" Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,culture=neutral" %> <MM:DataSet id="DataSet1" runat="Server" IsStoredProcedure="false" ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_Conn") %>' DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_Conn") %>' CommandText='<%# "SELECT * FROM dbo.deptos" %>' Debug="true" ></MM:DataSet> <MM:PageBind runat="server" PostBackBind="true" /> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Documento sin título</title> </head> <body> <script runat="server"> sub page_load(sender as object, e as eventargs) if not ispostback() then depto.text="Gastos generales" end if end sub sub cambio(sender as object, e as eventargs) depto.text=numdept.selecteditem.value end sub </script> <form runat="server"> <p> <asp:DropDownList ID="numdept" DataSource="<%# DataSet1.DefaultView %>" DataTextField="depto" DataValueField="nombre" runat="server" OnSelectedIndexChanged="cambio" AutoPostBack="true"></asp:DropDownList> </p> <p> <asp:Label ID="depto" runat="server" /> </p> </form> </body> </html>
Gracias