|
-
Jul 19th, 2007, 12:12 AM
#1
Thread Starter
Lively Member
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>
-
Jul 20th, 2007, 06:34 AM
#2
Re: ASP.NET VB Page Generation Time
[Edited]
System.Timers.Timer
Last edited by mendhak; Jul 23rd, 2007 at 11:25 AM.
-
Jul 22nd, 2007, 09:35 PM
#3
Thread Starter
Lively Member
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?
-
Jul 23rd, 2007, 11:26 AM
#4
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|