Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2004
    Location
    USA
    Posts
    54

    Unanswered: Client-side vs. Server-side scripts

    Hi, All,

    I need to make sure I understand this concept of server vs. client processing in ASP 3.0.

    Can someone tell me the differences for the following codes?

    1) <% Set abc = CreateObject("OWC10.Chart") %>
    2) <% Set abc = Server.CreateObject("OWC10.CHART") %>
    3) <Script Language=VBScript> Set abc = CreateObject("OWC10.CHART") </Script>
    4) < <Script Language=VBScript> Set abc = Server.CreateObject("OWC10.CHART") </Script>

    I guess I want to know where exactly this "OWC10.CHART" object (or component) the code is trying to use in each of these examples?

    Thanks.

  2. #2
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    for 1 and 2 you can be pretty sure that the object will be on the server... primarily because IIS will recognise the <% as a tag for server side script...

    with 3 and 4 it is a little more difficult... they will probably also be on the server but since you are using the <script> tag instead you should really explicitly force the execution at the server..

    can you tell us what you are trying to achieve??

  3. #3
    Join Date
    Aug 2004
    Location
    USA
    Posts
    54
    I am trying to see if the OWC10 component is installed on the client machine or not. If I force it to CreateObject on the client machine and failed, then I know the component is not installed.
    I think I understand where it is processed - 1 & 2 are on server and 3 & 4 are on client, but I am confused where and which component (client or server's) it is trying to use to create this object, since both the server and client may have this particular component installed, but may have different versions.

  4. #4
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    okie then, what you really want to try is something like...
    Code:
    <Script Language="VBScript" runat="Client"> 
    OnError Resume Next
    Set abc = Server.CreateObject("OWC10.CHART") 
    if Err.Number <> 0 then
      ' do whatever it is you want to do if the component is not installed
    else
      ' do whatever it is you want to do if the component is installed
      set abc=nothing
    end if
    </Script>
    that will force the execution of the script to the client (according the msdn)

  5. #5
    Join Date
    Aug 2004
    Location
    USA
    Posts
    54
    Very well, thank you very much.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •