- lapage.aspx (pour ceux qui n'utilisent pas visual studio remplacer codebehind par src)
- -----------------------------------------------------------------------------------------------------
- <%@ Page Language="vb" AutoEventWireup="false" Codebehind="lapage.aspx.vb" Inherits="monespace.lapage"%>
- <HTML>
- <HEAD id="Head" runat="server">
- <title id="title" runat="server"></title>
- <meta name="keywords" content="" id="keywords" runat="server"></meta>
- <meta name="description" content="" id="description" runat="server"></meta>
- <meta name="robots" content="" id="robots" runat="server"></meta>
- <meta HTTP-EQUIV="imagetoolbar" content="" id="imagetoolbar" runat="server"></meta>
- <LINK href="" type='text/css' rel='stylesheet' id="Style_1" runat="server"></LINK>
- </HEAD>
- <BODY id="Body" runat="server">
- <form id="Frm" method="post" runat="server">
- </form>
- </BODY>
- </HTML>
-
- -----------------------------------------------------------------------------------------------------
- lapage.aspx.vb
- -------------------------------------------------------------------------------------------------------
- Imports System.Web.UI.HtmlControls
-
-
- et dans le page load
-
- Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
-
- title.InnerText = "un titre tres texto"
- keywords.Attributes("content") = "des,mots,clefs"
- description.Attributes("content") = "comment tout ca qu'on fait"
- robots.Attributes("content") = "INDEX,FOLLOW"
- imagetoolbar.Attributes("content") = "yes"
- style_1.Attributes("href") = "Styles/Test.css"
-
- Body.Attributes.Add("scroll", "no")
-
- Dim plh As New PlaceHolder()
- Frm.Controls.Add(plh)
-
- Dim lit As New Literal()
-
- Dim h As New System.Web.UI.HtmlControls.HtmlAnchor()
- h.Name = "Haut"
-
- lit.Text = title.InnerText + "<br/>"
-
- Dim i As Int32
- For i = 0 To 40
- lit.Text += i.ToString + "<br/>"
- Next
-
- Dim hp As New HyperLink()
- hp = CreeAncre()
-
- plh.Controls.Add(h)
- plh.Controls.Add(lit)
- plh.Controls.Add(hp)
-
- End Sub
-
-
- Public Function CreeAncre(Optional ByVal Page As String = "default.aspx", Optional ByVal ou As Boolean = True) As HyperLink
-
- Page = "tete.aspx"
- Dim hp As New HyperLink()
- Dim ancre As String
-
- If ou Then
- ancre = "Haut"
- Else
- ancre = "Bas"
- End If
-
- hp.NavigateUrl = Page + "#" + ancre
- hp.Text = ancre ' dans la langue
-
- Return hp
-
- End Function
-
lapage.aspx (pour ceux qui n'utilisent pas visual studio remplacer codebehind par src)
-----------------------------------------------------------------------------------------------------
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="lapage.aspx.vb" Inherits="monespace.lapage"%>
<HTML>
<HEAD id="Head" runat="server">
<title id="title" runat="server"></title>
<meta name="keywords" content="" id="keywords" runat="server"></meta>
<meta name="description" content="" id="description" runat="server"></meta>
<meta name="robots" content="" id="robots" runat="server"></meta>
<meta HTTP-EQUIV="imagetoolbar" content="" id="imagetoolbar" runat="server"></meta>
<LINK href="" type='text/css' rel='stylesheet' id="Style_1" runat="server"></LINK>
</HEAD>
<BODY id="Body" runat="server">
<form id="Frm" method="post" runat="server">
</form>
</BODY>
</HTML>
-----------------------------------------------------------------------------------------------------
lapage.aspx.vb
-------------------------------------------------------------------------------------------------------
Imports System.Web.UI.HtmlControls
et dans le page load
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
title.InnerText = "un titre tres texto"
keywords.Attributes("content") = "des,mots,clefs"
description.Attributes("content") = "comment tout ca qu'on fait"
robots.Attributes("content") = "INDEX,FOLLOW"
imagetoolbar.Attributes("content") = "yes"
style_1.Attributes("href") = "Styles/Test.css"
Body.Attributes.Add("scroll", "no")
Dim plh As New PlaceHolder()
Frm.Controls.Add(plh)
Dim lit As New Literal()
Dim h As New System.Web.UI.HtmlControls.HtmlAnchor()
h.Name = "Haut"
lit.Text = title.InnerText + "<br/>"
Dim i As Int32
For i = 0 To 40
lit.Text += i.ToString + "<br/>"
Next
Dim hp As New HyperLink()
hp = CreeAncre()
plh.Controls.Add(h)
plh.Controls.Add(lit)
plh.Controls.Add(hp)
End Sub
Public Function CreeAncre(Optional ByVal Page As String = "default.aspx", Optional ByVal ou As Boolean = True) As HyperLink
Page = "tete.aspx"
Dim hp As New HyperLink()
Dim ancre As String
If ou Then
ancre = "Haut"
Else
ancre = "Bas"
End If
hp.NavigateUrl = Page + "#" + ancre
hp.Text = ancre ' dans la langue
Return hp
End Function