how to avoid late binding

G

Guest

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
 
C

Cowboy \(Gregory A. Beamer\)

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!
**********************************************************************
 
M

Marina

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.
 
P

Patrice Scribe

Make footerValues an array of strings instead of just an array of objects...

Patrice
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top