ASP.NET VB Page Generation Time
I'm trying to incorporate into my web pages who long the server took to generate the requested information. So far, I have had no luck on Google or any other developer forums. Below is some code I am working on but I am getting the error message BC30002: Type 'System.Diagnostics.Stopwatch' is not defined.
Code:
<%@ Page Language="vb" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Web.UI.Page" %>
<%@ Import Namespace="System.Diagnostics.Stopwatch" %>
<script runat="server">
dim sw as System.Diagnostics.Stopwatch =
System.Diagnostics.Stopwatch.StartNew()
Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
Me.Label1.Text = sw.ElapsedSeconds
MyBase.Render(writer)
End Sub
</script>
Re: ASP.NET VB Page Generation Time
[Edited]
System.Timers.Timer
Re: ASP.NET VB Page Generation Time
I tried to import System.Timers into the Namespace but still no go. Could you please provide some example code?
Re: ASP.NET VB Page Generation Time
Do you actually get any intellisense when you code like that? Why aren't you using a codebehind?
I've amended my post. It should be System.Timers.Timer. If you can't find it, add a reference to your project and see if there's a DLL called System.Timers, because I think it should be there by default anyways.