Foros del Web » Programando para Internet » ASPX (.net) »

DropDownList + Label

Estas en el tema de DropDownList + Label en el foro de ASPX (.net) en Foros del Web. Saludos..... Tengo el siguiente codigo hecho en Dream + ASP.Net ..... Código: <%@ 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 ...
  #1 (permalink)  
Antiguo 28/02/2006, 16:31
 
Fecha de Ingreso: noviembre-2003
Mensajes: 209
Antigüedad: 20 años, 5 meses
Puntos: 0
DropDownList + Label

Saludos.....

Tengo el siguiente codigo hecho en Dream + ASP.Net .....

Código:
<%@ 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&iacute;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>
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?

Gracias
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 20:45.