Server.URLEncode :-( [英] Server.URLEncode :-(

查看:65
本文介绍了Server.URLEncode :-(的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我在从SQL数据库中删除一些数据时遇到问题,并且显示为超链接的


超链接将数据插入到查询字符串中,以便下一页可以读取

它。


但是,有些数据有萎缩(' ')在其中,因此页面没有正确地重定向(无效语法)因为萎缩。

因此我尝试使用URL编码来解决这个问题没有用 - 它没有

工作。

超链接如下,这是正确的 - 如果是这样,为什么它不工作

:-( ?这是解决这个问题的最佳方式吗?


*****


< a href = " page2.asp?DATA =<%server.URLEncode(= RS(" Value")))%>"><%

= RS(" Value") %>< / a>


*****


谢谢

-

提前致谢


Fawke

请在给我发电子邮件之前从我的电子邮件地址中删除ANTI和SPAM



www.bradflack.com

Hi there,

I am having trouble with some data that is ripped from a SQL database and
displayed as a hyperlink.
The hyperlink inserts the data into a querystring so the next page can read
it.

However, some of the data has apostrophies ('') in it, so the page does not
redirect properly (invalid syntax) because of the apostrophy.
so i tried to use the URL encode to get around this to no avail - it doesnt
work.
The hyperlink is as follows, is this correct - if so why aint it working
:-( ? and is this the "best" way to get around this problem?

*****

<a href= "page2.asp?DATA=<% server.URLEncode(=RS("Value"))%>"><%
=RS("Value")%></a>

*****

Thanks
--
Thanks in advance

Fawke

Please remove ANTI and SPAM
from my email address before emailing me.

www.bradflack.com

推荐答案

" Fawke101" < gu*@ANTIbradflack.SPAMcom>写在消息

新闻:嗯************** @ TK2MSFTNGP09.phx.gbl ...
"Fawke101" <gu*@ANTIbradflack.SPAMcom> wrote in message
news:um**************@TK2MSFTNGP09.phx.gbl...
但是,有些数据中有叛逆(''),因此页面没有正确地重定向(语法无效)因为萎缩。
因此我尝试使用URL编码来解决这个问题无济于事 - 它是
不起作用。
超链接如下,这是正确的 - 如果是这样,为什么它不工作
:-(?这是解决这个问题的最佳方式?

< a href =" page2.asp?DATA =<%server.URLEncode(= RS(" Value") )%>"><%
= RS(" Value")%>< / a>

*****
However, some of the data has apostrophies ('') in it, so the page does not
redirect properly (invalid syntax) because of the apostrophy.
so i tried to use the URL encode to get around this to no avail - it doesnt work.
The hyperlink is as follows, is this correct - if so why aint it working
:-( ? and is this the "best" way to get around this problem?

*****

<a href= "page2.asp?DATA=<% server.URLEncode(=RS("Value"))%>"><%
=RS("Value")%></a>

*****




你在
server.URLEncode之前缺少等号或Response.Write语句,并且在RS(Value)之前你有一个错误的等号。

试试这个:

< a href =

" page2.asp?DATA =<%= server.URLEncode(RS( " Va的略"))%> "><%= RS(" Value")%>< / a>


问候,

Peter Foti


URL中的撇号无关紧要。以什么方式,它不起作用?

你收到错误吗? RS的价值是什么(价值)?您在视图源中的链接是什么样的?b $ b?什么时候发生错误?什么代码

发生错误?


雷在工作

Fawke101 < gu*@ANTIbradflack.SPAMcom>写在消息

新闻:嗯************** @ TK2MSFTNGP09.phx.gbl ...
An apostrophe in a URL shouldn''t matter. In what way, "aint it working?"
Do you get an error? What is the value of RS("Value")? What does your link
look like in a view source? When does the error occur? In what code does
the error occur?

Ray at work
"Fawke101" <gu*@ANTIbradflack.SPAMcom> wrote in message
news:um**************@TK2MSFTNGP09.phx.gbl...
你好,

我从一个从SQL数据库中删除的数据出现问题并显示为超链接。
超链接将数据插入查询字符串,以便下一页可以
读它。

但是,有些数据中有一些瑕疵(''),所以由于萎缩,页面没有正确地重定向(语法无效)。
所以我试图使用URL编码绕过这个无济于事 - 它
不起作用。
超链接如下,这是正确的 - 如果是这样,为什么它不工作
: - (?这是解决这个问题的最佳方法吗?

< a href =" page2.asp? DATA =<%server.URLEncode(= RS(" Value")))%>"><%
= RS(" Value")%>< / a>

*****

谢谢
-
提前致谢

Fawke

请在给我发电子邮件之前从我的电子邮件地址中删除ANTI和垃圾邮件。

www.bradflack.com
Hi there,

I am having trouble with some data that is ripped from a SQL database and
displayed as a hyperlink.
The hyperlink inserts the data into a querystring so the next page can read it.

However, some of the data has apostrophies ('') in it, so the page does not
redirect properly (invalid syntax) because of the apostrophy.
so i tried to use the URL encode to get around this to no avail - it doesnt work.
The hyperlink is as follows, is this correct - if so why aint it working
:-( ? and is this the "best" way to get around this problem?

*****

<a href= "page2.asp?DATA=<% server.URLEncode(=RS("Value"))%>"><%
=RS("Value")%></a>

*****

Thanks
--
Thanks in advance

Fawke

Please remove ANTI and SPAM
from my email address before emailing me.

www.bradflack.com



好的,


网址中的萎患很好。但是当下一页试图按
读取它并根据这些数据发出一个SELECT语句时它就会变成梨形。

select语句如下。


***

设置RS = DataConnection.Execute(" SELECT COL1,COL2 FROM VIEW1 WHERE

VIEW1.COL3 =''"& request.querystring(" Value")&"''")

***


即使在URL中使用URL编码,页面仍然会在S附近显示不正确

语法。有问题的数据是


---> St Mathew''s Park


并非所有数据都有萎缩,而且这很有效,我只需要一个通用的

解决方案来确保数据还可以(我不完全明白如何使用
加入替换功能)

为什么在这种情况下URL编码不起作用???


-

提前致谢


Fawke


请删除ANTI和垃圾邮件<在给我发电子邮件之前,我的电子邮件地址是


www .bradflack.com

" Ray at<%= sLocation%> [MVP] QUOT; < myfirstname at lane34 dot com>写在

消息新闻:#h ************** @ TK2MSFTNGP09.phx.gbl ...
OK,

The apostrophy goes fine in the URL. But its when the next page tries to
read it and issue a SELECT statement in accordance to this data that it all
goes pear shaped.

The select statement is as follows.

***
Set RS = DataConnection.Execute("SELECT COL1, COL2 FROM VIEW1 WHERE
VIEW1.COL3=''" & request.querystring("Value") & "''")
***

Even with the URL encode in the URL, the page still errors saying "Incorrect
syntax near ''S''." the data in question is

---> "St Mathew''s Park"

Not all the data has an apostrophy, and this works, i just need a universal
solution to make sure the data is ok (i dont fully understand how to
encorporate a Replace function)
Why isnt the URL Encode working in this case???

--
Thanks in advance

Fawke

Please remove ANTI and SPAM
from my email address before emailing me.

www.bradflack.com
"Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
message news:#h**************@TK2MSFTNGP09.phx.gbl...
一个撇号网址无关紧要。以什么方式,它不起作用?
你得到一个错误? RS的价值是什么(价值)?您的
链接在视图源中的含义是什么?什么时候发生错误?用什么代码来发生错误?

Ray在工作中

Fawke101 < gu*@ANTIbradflack.SPAMcom>在消息中写道
新闻:嗯************** @ TK2MSFTNGP09.phx.gbl ...
An apostrophe in a URL shouldn''t matter. In what way, "aint it working?"
Do you get an error? What is the value of RS("Value")? What does your link look like in a view source? When does the error occur? In what code does
the error occur?

Ray at work
"Fawke101" <gu*@ANTIbradflack.SPAMcom> wrote in message
news:um**************@TK2MSFTNGP09.phx.gbl...
你好,
中删除的一些数据出现问题并显示为超链接。
超链接将数据插入查询字符串,以便下一页可以
Hi there,

I am having trouble with some data that is ripped from a SQL database and displayed as a hyperlink.
The hyperlink inserts the data into a querystring so the next page can


读取

它。

但是,有些数据中有一些瑕疵(''),所以页面确实
没有正确重定向(语法无效)因为萎缩。
所以我试图使用URL编码来解决这个问题无效 - 它
it.

However, some of the data has apostrophies ('') in it, so the page does not redirect properly (invalid syntax) because of the apostrophy.
so i tried to use the URL encode to get around this to no avail - it


不会

工作。
超链接如下,这是正确的 - 如果是这样,为什么它不工作
:-(?这是解决这个问题的最佳方式吗?

**** *

< a href =" page2.asp?DATA =<%server.URLEncode(= RS(" Value")))%>"><%
= RS(" Value")%>< / a>



谢谢
-
提前致谢

Fawke

请删除ANTI在给我发电子邮件之前,请通过我的电子邮件地址发送垃圾邮件。

www。 bradflack.com
work.
The hyperlink is as follows, is this correct - if so why aint it working
:-( ? and is this the "best" way to get around this problem?

*****

<a href= "page2.asp?DATA=<% server.URLEncode(=RS("Value"))%>"><%
=RS("Value")%></a>

*****

Thanks
--
Thanks in advance

Fawke

Please remove ANTI and SPAM
from my email address before emailing me.

www.bradflack.com




这篇关于Server.URLEncode :-(的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆