Error in passing multiple variables in a href

J

Jack

Hi,
I need to pass multple variables in a link in order to go to a asp page with
the
two varables.

The following are the values of the variables using response.write:
<%'Response.Write Mypage & "<br>"%>
Exp

<%'Response.Write GrantID & "<br>"%>
4836

The link which I wrote is as follows:

<A HREF="mainreportagain1.asp?grantid=<%=GrantID%> & page=<%mypage%>">Report
Main Page</A>

However, when I am refreshing the page to click this link I am getting the
following error: Microsoft VBScript runtime (0x800A000D)
Type mismatch

I would appreciate any help to resolve this. Thanks.
 
K

Kyle Peterson

not sure exaclty what your doing or why, but right off the bat I see a
mistake

Main Page</A>

should be

Main Page</A>

you were missing the equals sign for mypage

you may also want to URL encode the MyPage variable so it passes from page
to page ok

like so
 
K

Kyle Peterson

Use server.urlencode like I showed you when you build the link and don't
worry about what you see in the url because the request.querystring method
will put the string back together the way you expect it to be when it grabs
the quersytring info

server.urlencode creates url safe strings that won't cause problems when
passing them from page to page

also realize that passing strings this way will be problem is you use too
many characters because there is a limit

I dont remeber what it is.. maybe 1024 characters or something ? maybe 2k
maybe a little more or less ? I can not remember

when passing large amounts of data you should POST your data with a form
instead of
using the queystring... and when using post do do use server.URLEncode
because it is taken care of by the form post

here is a little more on passing data from page to page

http://www.powerasp.com/content/hintstips/asp-forms.asp
 

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,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top