Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > how to avoid late binding

Reply
Thread Tools

how to avoid late binding

 
 
=?Utf-8?B?VGhvbWFzIE3DvGxsZXItTHluY2g=?=
Guest
Posts: n/a
 
      02-02-2004
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

 
Reply With Quote
 
 
 
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      02-02-2004
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:(E-Mail Removed)...
> 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.
>



 
Reply With Quote
 
 
 
 
Marina
Guest
Posts: n/a
 
      02-02-2004
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:(E-Mail Removed)...
> 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.
>



 
Reply With Quote
 
Patrice Scribe
Guest
Posts: n/a
 
      02-02-2004
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:(E-Mail Removed)...
> 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.
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
pywin32 COM sort in Excel (late binding fails, early binding works) (+py2exe) kogrover@gmail.com Python 2 10-20-2006 04:08 PM
Plugins and Late Binding ThunderMusic ASP .Net 4 04-12-2005 05:57 PM
Option Strict On disallows late binding. Ryan McLean ASP .Net 3 06-14-2004 05:49 PM
option strict disallows late binding reading from web.config Karl Lang ASP .Net 1 06-01-2004 10:56 AM
problem with owc10 and late binding PatLaf ASP .Net 3 01-10-2004 06:03 PM



Advertisments