By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,240 Members | 791 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,240 IT Pros & Developers. It's quick & easy.

Error in passing multiple variables in a href

P: n/a
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.

Jul 22 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
page=<%mypage%>">

should be;

page=<%=mypage%>">

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

"Jack" <Ja**@discussions.microsoft.com> wrote in message news:3F**********************************@microsof t.com...
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.




Jul 22 '05 #2

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

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

<A HREF="mainreportagain1.asp?grantid=<% =GrantID %> & page=<% =mypage
%>">Report 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

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

"Jack" <Ja**@discussions.microsoft.com> wrote in message
news:3F**********************************@microsof t.com... 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.

Jul 22 '05 #3

P: n/a
Thanks to you Kyle and Steven. With the following code:
<A HREF="mainreportagain1.asp?grantid=<%=GrantID%>&pa ge=<%=mypage%>">Report
Main Page</A>
the link works. However, when I see the final page the link is shown as above:

http://localhost/gwisbrandnewready6m...36%20&page=Exp

I would like to know hot to get rid of %20that is coming between 4836 and
the &.
Regards.
"Kyle Peterson" wrote:
not sure exaclty what your doing or why, but right off the bat I see a
mistake

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


should be

<A HREF="mainreportagain1.asp?grantid=<% =GrantID %> & page=<% =mypage
%>">Report
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

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

"Jack" <Ja**@discussions.microsoft.com> wrote in message
news:3F**********************************@microsof t.com...
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.


Jul 22 '05 #4

P: n/a
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


"Jack" <Ja**@discussions.microsoft.com> wrote in message
news:F0**********************************@microsof t.com...
Thanks to you Kyle and Steven. With the following code:
<A
HREF="mainreportagain1.asp?grantid=<%=GrantID%>&pa ge=<%=mypage%>">Report
Main Page</A>
the link works. However, when I see the final page the link is shown as
above:

http://localhost/gwisbrandnewready6m...36%20&page=Exp

I would like to know hot to get rid of %20that is coming between 4836 and
the &.
Regards.
"Kyle Peterson" wrote:
not sure exaclty what your doing or why, but right off the bat I see a
mistake

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


should be

<A HREF="mainreportagain1.asp?grantid=<% =GrantID %> & page=<% =mypage
%>">Report
> 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

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

"Jack" <Ja**@discussions.microsoft.com> wrote in message
news:3F**********************************@microsof t.com...
> 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.
>
>
>


Jul 22 '05 #5

P: n/a
Thanks Kyle for the generous advise. I appreciate it. Regards

"Kyle Peterson" wrote:
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


"Jack" <Ja**@discussions.microsoft.com> wrote in message
news:F0**********************************@microsof t.com...
Thanks to you Kyle and Steven. With the following code:
<A
HREF="mainreportagain1.asp?grantid=<%=GrantID%>&pa ge=<%=mypage%>">Report
Main Page</A>
the link works. However, when I see the final page the link is shown as
above:

http://localhost/gwisbrandnewready6m...36%20&page=Exp

I would like to know hot to get rid of %20that is coming between 4836 and
the &.
Regards.
"Kyle Peterson" wrote:
not sure exaclty what your doing or why, but right off the bat I see a
mistake

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

should be

<A HREF="mainreportagain1.asp?grantid=<% =GrantID %> & page=<% =mypage
%>">Report
> 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

<A HREF="mainreportagain1.asp?grantid=<% =GrantID %> & page=<%
=Server.URLEncod(mypage) %>">Report
> Main Page</A>
"Jack" <Ja**@discussions.microsoft.com> wrote in message
news:3F**********************************@microsof t.com...
> 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.
>
>
>


Jul 22 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.