Use code behind to set value to asp:Literal

Saranya Boopathi
Posted by Saranya Boopathi under VB.NET category on | Points: 40 | Views : 1580
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="LiteralTime" %>

<html xmlns="" >
<head runat="server">
<title>Untitled Page</title>
<form id="form1" runat="server">
<asp:literal runat="server" ID="currentTime"></asp:literal>

File: Default.aspx.vb

Partial Class LiteralTime
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
currentTime.Text = DateTime.Now
End Sub
End Class

Comments or Responses

Login to post response