Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Tarea sesión 4
1
2
3
4
5
Codigo
6
Private Sub chkSitio_CheckedChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles chkSitio.CheckedChanged
txtURL.Enabled = chkSitio.Checked
btnVerSitio.Enabled = chkSitio.Checked
End Sub
Ejecución
7
8
Creación de una página Web ASP.NET, prueba e identificación de
sus elementos
9
Codigo
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Usuario.aspx.vb"
Inherits="Usuario" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body style="height: 350px">
<form id="form1" runat="server">
<div>
</div>
<asp:Label ID="Label1" runat="server"
style="z-index: 1; left: 14px; top: 40px; position: absolute"
Text="Nombre:"></asp:Label>
<asp:TextBox ID="txtNombre" runat="server" MaxLength="40"
style="z-index: 1; left: 65px; top: 36px; position: absolute; width:
278px"
ToolTip="Capture aquí su nombre"></asp:TextBox>
<p>
<asp:TextBox ID="txtCorreo" runat="server" MaxLength="40"
10
style="z-index: 1; left: 62px; top: 65px; position: absolute; width:
279px"
ToolTip="Capture aquí su correo electrónico"></asp:TextBox>
</p>
<p>
<asp:Label ID="Label4" runat="server"
style="z-index: 1; left: 14px; top: 135px; position: absolute"
Text="Inicio:"></asp:Label>
<asp:TextBox ID="txtEdad" runat="server" MaxLength="3"
style="z-index: 1; left: 60px; top: 103px; position: absolute; width:
57px"
ToolTip="Capture su edad (0 a 100)"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1"
runat="server"
ControlToValidate="txtCorreo" Display="Dynamic"
ErrorMessage="Formato de correo electrónico incorrecto."
style="z-index: 1; left: 407px; top: 64px; position: absolute; width:
8px"
ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-
.]\w+)*">*</asp:RegularExpressionValidator>
</p>
<p>
<asp:TextBox ID="txtInicio" runat="server"
style="z-index: 1; left: 59px; top: 134px; position: absolute; width:
276px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="txtNombre" Display="Dynamic"
ErrorMessage=" El nombre no debe omitirse"
style="z-index: 1; left: 364px; top: 37px; position: absolute; bottom:
249px">*</asp:RequiredFieldValidator>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ControlToValidate="txtCorreo" Display="Dynamic"
ErrorMessage="El correo no puede omitirse"
style="z-index: 1; left: 362px; top: 64px; position: absolute; width:
13px; right: 546px">*</asp:RequiredFieldValidator>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
ControlToValidate="txtEdad" Display="Dynamic"
ErrorMessage="La edad no puede omitirse"
style="z-index: 1; left: 139px; top: 98px; position:
absolute">*</asp:RequiredFieldValidator>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server"
ControlToValidate="txtInicio" Display="Dynamic"
ErrorMessage="La fecha de inicio de servicios no debe omitirse"
style="z-index: 1; left: 359px; top: 129px; position: absolute;
height: 20px">*</asp:RequiredFieldValidator>
</p>
<asp:RangeValidator ID="RangeValidator1" runat="server"
ControlToValidate="txtEdad" Display="Dynamic"
ErrorMessage="La edad no está dentro del rango permitido"
MaximumValue="100"
MinimumValue="0"
style="z-index: 1; left: 185px; top: 98px; position: absolute; right:
728px"
Type="Integer">*</asp:RangeValidator>
11
<asp:CompareValidator ID="CompareValidator1" runat="server"
ControlToValidate="txtEdad" Display="Dynamic"
ErrorMessage="La edad debe ser un número entero" Operator="DataTypeCheck"
style="z-index: 1; left: 227px; top: 97px; position:
absolute">*</asp:CompareValidator>
<asp:Calendar ID="calInicio" runat="server"
style="z-index: 1; left: 100px; top: 170px; position: absolute; height:
188px; width: 259px">
</asp:Calendar>
<asp:CustomValidator ID="CustomValidator1" runat="server"
ControlToValidate="txtInicio" Display="Dynamic"
ErrorMessage="La fecha de inicio de uso es incorrecta"
style="z-index: 1; left: 386px; top: 127px; position:
absolute">*</asp:CustomValidator>
<asp:Button ID="btnAceptar" runat="server"
style="z-index: 1; left: 102px; top: 367px; position: absolute"
Text="Aceptar datos" />
<hr style="z-index: 1; left: 13px; top: 391px; position: absolute; height:
16px; width: 901px" />
<asp:HyperLink ID="HyperLink1" runat="server"
NavigateUrl="http://www.aprendapracticando.com"
style="z-index: 1; left: 23px; top: 434px; position: absolute">Ir al sitio
de Aprenda Practicando</asp:HyperLink>
<asp:ValidationSummary ID="ValidationSummary1" runat="server"
ShowMessageBox="True" ShowSummary="False"
style="z-index: 1; left: 4px; top: 480px; position: absolute; height:
38px; width: 901px" />
</form>
</body>
</html>
12
Ejecución
13
Identificación de elementos
Calendario (Calendar)
Hipervínculo (HyperLink).
14