Help with inline code?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • brett

    #1

    Help with inline code?

    I'd like to use a conditional that checks the URL to make sure I'm not
    on the localhost, which will increment the counter. I want the counter
    to work only when the page is on the web server. I have the long
    string below which is not fitting into the Response.Write( ) method as
    one string.


    <script language="C#" runat="server">
    private void showCounter()
    {
    Response.Write( @"
    <!-- Start of Code -->
    <script type="text/javascript" language="javas cript">
    var sc_project=1000 ;
    var sc_invisible=1;
    var sc_partition=10 ;
    var sc_security="77 08ea54";

    </script>
    <script type="text/javascript" language="javas cript"
    src="http://www.abc.com/counter/counter.js"></script>
    <noscript>
    <a href="http://www.abc.com/" target="_blank" ><img
    src="http://c11.abc.com/counter.php?sc_ project=1000&am p;java=0&amp;se curity=7708ea54 &amp;invisible= 1"
    alt="free statistics" border="0"></a>
    </noscript>
    <!-- End of Code -->
    ");
    }
    </script>


    How should I be doing this?

    Thanks,
    Brett

  • Dan

    #2
    Re: Help with inline code?

    Not sure what you are trying to achieve. aere you trying to make a page
    counter to judge how many hits your site gets? If so why not make a
    statistics table in your db and increment a value in there everytime a
    appstart event is called? Then read this back when you need to display your
    counter?

    --
    Dan
    "brett" <account@cygen. com> wrote in message
    news:1136530552 .139206.171060@ o13g2000cwo.goo glegroups.com.. .[color=blue]
    > I'd like to use a conditional that checks the URL to make sure I'm not
    > on the localhost, which will increment the counter. I want the counter
    > to work only when the page is on the web server. I have the long
    > string below which is not fitting into the Response.Write( ) method as
    > one string.
    >
    >
    > <script language="C#" runat="server">
    > private void showCounter()
    > {
    > Response.Write( @"
    > <!-- Start of Code -->
    > <script type="text/javascript" language="javas cript">
    > var sc_project=1000 ;
    > var sc_invisible=1;
    > var sc_partition=10 ;
    > var sc_security="77 08ea54";
    >
    > </script>
    > <script type="text/javascript" language="javas cript"
    > src="http://www.abc.com/counter/counter.js"></script>
    > <noscript>
    > <a href="http://www.abc.com/" target="_blank" ><img
    > src="http://c11.abc.com/counter.php?sc_ project=1000&am p;java=0&amp;se curity=7708ea54 &amp;invisible= 1"
    > alt="free statistics" border="0"></a>
    > </noscript>
    > <!-- End of Code -->
    > ");
    > }
    > </script>
    >
    >
    > How should I be doing this?
    >
    > Thanks,
    > Brett
    >[/color]


    Comment

    • brett

      #3
      Re: Help with inline code?

      No - I already have a page counter. I just need to hide it when I'm on
      the local computer and display it when I'm on the web server. I only
      want hits from the web server.

      Brett

      Comment

      Working...