Ver Mensaje Individual
  #2 (permalink)  
Antiguo 12/07/2010, 03:04
dikcc
 
Fecha de Ingreso: junio-2010
Mensajes: 134
Antigüedad: 13 años, 10 meses
Puntos: 0
Respuesta: Validar datos introducidos al realizar un selectedindexchanged con un drop

Tengo un formulario con nombre, direccion y codigo postal, aparte de otras cosas. Dicho formulario esta dentro de un dropdownlist del 1 al N para seleccionar entre N usuarios. Cuando entras en la páginas ASPX el drop vale "1" y modificas los datos del usuario "1", pero al cambiar en el drop a "3" (por ejemplo) necesito validar los datos del usuario "1", es decir, que el nombre, la direccion y el codigo postal sean correctos, y sino no dejarle acceder a modificar los datos del usuario "3".
¿Sabes como puedo hacerlo?
Mando el trozo de código.

<asp:Literal ID="litFrase1" runat="server" Text="<b>Ubicación Nº </b>"></asp:Literal>
<asp:DropDownList runat="server" ID="ddlUbicaciones" onselectedindexchanged="ddlUbicaciones_SelectedInd exChanged"></asp:DropDownList>
<br />
<br />
<asp:Literal ID="litNombreLocalizacion" runat="server" Text="Nombre de este local" meta:resourcekey="litNombreLocalizacionResource1"> </asp:Literal>
<asp:TextBox ID="ubicacion" runat="server"></asp:TextBox>
<%--<asp:RequiredFieldValidator runat="server" ID="rfvUbicacion" ControlToValidate="ubicacion" ErrorMessage="Error en la ubicacion" Display="Dynamic"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator runat="server" ID="revUbicacion" ControlToValidate="ubicacion" ErrorMessage="Error en la ubicacion al registrar" ValidationExpression="^[0-9]{5}$" ></asp:RegularExpressionValidator>--%>
<br />
<br />
<div runat="server" id="paisprovmuni">
<asp:Literal ID="litPais" runat="server" Text="Pais"></asp:Literal>
<asp:DropDownList runat="server" ID="ddlPais" AutoPostBack="true" Enabled="true" onselectedindexchanged="ddlPais_SelectedIndexChang ed" ></asp:DropDownList>
<br />
<br />
<asp:Literal ID="litProvincia" runat="server" Text="Provincia"></asp:Literal>
<asp:DropDownList ID="ddlProvincia" AutoPostBack="true" onselectedindexchanged="ddlProvincia_SelectedIndex Changed" Enabled="true" runat="server"></asp:DropDownList>
<br />
<br />
<asp:Literal ID="litMunicipio" runat="server" Text="Municipio"></asp:Literal>
<asp:DropDownList ID="ddlMunicipio" runat="server" Enabled="true"></asp:DropDownList>
<br />
<br />
</div>

<asp:Literal ID="litDireccion" runat="server" Text="Dirección" meta:resourcekey="litDireccionResource1"></asp:Literal>
<asp:TextBox ID="tbDireccion" runat="server" maxlength="30"/>
<br />
<br />
<asp:Literal ID="litCodigoPostal" runat="server" Text="Código Postal" meta:resourcekey="litCodigoPostalResource1"></asp:Literal>
<asp:TextBox ID="tbCP" runat="server" MaxLength="5"/>
<br />
<br />
<asp:Literal id="litZonaHoraria" runat="server" Text="Zona horaria" meta:resourcekey="litZonaHorariaResource1"></asp:Literal>
<asp:DropDownList ID="ddlZonaHoraria" runat="server"></asp:DropDownList>
<br />
<br />
<asp:Literal ID="litHoraNegocio" runat="server" Text="Hora de negocio" meta:resourcekey="litHoraNegocioResource></asp:Literal>
<asp:DropDownList runat="server" ID="ddlHora"></asp:DropDownList>
<br />
<br />

Gracias por todo.