how to avoid late binding

Discussion in 'ASP .Net' started by =?Utf-8?B?VGhvbWFzIE3DvGxsZXItTHluY2g=?=, Feb 2, 2004.

  1. How can I avoid late binding with the directive strict = tru

    My ASP .net-file looks like this

    <%@DEBUG=true TRACE=true Strict=false EXPLICIT=true%
    ..
    dim footerValues as Arra
    footerValues = split("val1,val2,val3,val4,val5", ","
    ..
    dim strDept as String = footerValues(0
    dim strDeptLink as String = footerValues(1
    dim strName as String = footerValues(2
    dim strNameLink as String = footerValues(3
    dim strEMailAddress as String = footerValues(4

    The compiler says it doesn't support late binding! But how can I avoid these error messages
    =?Utf-8?B?VGhvbWFzIE3DvGxsZXItTHluY2g=?=, Feb 2, 2004
    #1
    1. Advertising

  2. You can still late bind with reflection, if necessary. I assume this is what
    you are getting at. You cannot use late binding with Strict without
    reflection, however.

    Now, you should be able to use an array like you are without error, but I
    would move the code into an event in the CodeBehind rather than place in the
    page, ala ASP. I think you will find that it works much better when you do
    that.

    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA

    **********************************************************************
    Think Outside the Box!
    **********************************************************************
    "Thomas Müller-Lynch" <thomas.mueller-lynch(remove)@cp.siemens.de> wrote in
    message news:...
    > How can I avoid late binding with the directive strict = true
    >
    > My ASP .net-file looks like this:
    >
    > <%@DEBUG=true TRACE=true Strict=false EXPLICIT=true%>
    > ...
    > dim footerValues as Array
    > footerValues = split("val1,val2,val3,val4,val5", ",")
    > ...
    > dim strDept as String = footerValues(0)
    > dim strDeptLink as String = footerValues(1)
    > dim strName as String = footerValues(2)
    > dim strNameLink as String = footerValues(3)
    > dim strEMailAddress as String = footerValues(4)
    >
    > The compiler says it doesn't support late binding! But how can I avoid

    these error messages.
    >
    Cowboy \(Gregory A. Beamer\), Feb 2, 2004
    #2
    1. Advertising

  3. =?Utf-8?B?VGhvbWFzIE3DvGxsZXItTHluY2g=?=

    Marina Guest

    I would do something like:

    Dim footerValues() As String
    footerValues = "val1,val2,val3,val4,val5".Split(","c)

    This should by type compatible.

    But as was suggested in the other post, try to avoid putting server side
    scripts in the .aspx directly. You lose all the compile time support VS.NET
    gives you. This also doesn't encourge you to think in OO ways, but
    encourages to continue writing code as was done in ASP, that uses
    Response.Write for everything.

    "Thomas Müller-Lynch" <thomas.mueller-lynch(remove)@cp.siemens.de> wrote in
    message news:...
    > How can I avoid late binding with the directive strict = true
    >
    > My ASP .net-file looks like this:
    >
    > <%@DEBUG=true TRACE=true Strict=false EXPLICIT=true%>
    > ...
    > dim footerValues as Array
    > footerValues = split("val1,val2,val3,val4,val5", ",")
    > ...
    > dim strDept as String = footerValues(0)
    > dim strDeptLink as String = footerValues(1)
    > dim strName as String = footerValues(2)
    > dim strNameLink as String = footerValues(3)
    > dim strEMailAddress as String = footerValues(4)
    >
    > The compiler says it doesn't support late binding! But how can I avoid

    these error messages.
    >
    Marina, Feb 2, 2004
    #3
  4. Make footerValues an array of strings instead of just an array of objects...

    Patrice

    --

    "Thomas Müller-Lynch" <thomas.mueller-lynch(remove)@cp.siemens.de> a écrit
    dans le message de
    news:...
    > How can I avoid late binding with the directive strict = true
    >
    > My ASP .net-file looks like this:
    >
    > <%@DEBUG=true TRACE=true Strict=false EXPLICIT=true%>
    > ...
    > dim footerValues as Array
    > footerValues = split("val1,val2,val3,val4,val5", ",")
    > ...
    > dim strDept as String = footerValues(0)
    > dim strDeptLink as String = footerValues(1)
    > dim strName as String = footerValues(2)
    > dim strNameLink as String = footerValues(3)
    > dim strEMailAddress as String = footerValues(4)
    >
    > The compiler says it doesn't support late binding! But how can I avoid

    these error messages.
    >
    Patrice Scribe, Feb 2, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ThunderMusic

    Plugins and Late Binding

    ThunderMusic, Jan 27, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    850
    Patrice
    Apr 12, 2005
  2. PatLaf

    problem with owc10 and late binding

    PatLaf, Jan 9, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    325
    Ken Cox [Microsoft MVP]
    Jan 10, 2004
  3. Karl Lang
    Replies:
    1
    Views:
    895
    Karl Lang
    Jun 1, 2004
  4. Ryan McLean

    Option Strict On disallows late binding.

    Ryan McLean, Jun 14, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    10,335
    mikeb
    Jun 14, 2004
  5. Replies:
    2
    Views:
    853
    Kevin Grover
    Oct 20, 2006
Loading...

Share This Page