Results 1 to 4 of 4

Thread: ASP.NET VB Page Generation Time

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2006
    Posts
    111

    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>

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: ASP.NET VB Page Generation Time

    [Edited]
    System.Timers.Timer
    Last edited by mendhak; Jul 23rd, 2007 at 11:25 AM.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2006
    Posts
    111

    Question 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?

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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
  •  



Click Here to Expand Forum to Full Width