超链接帮助...... [英] Hyperlink help...

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

问题描述

我是一名新手程序员。

我希望有一个如下所示的超链接: www.mycoolsite.com?a=21132

点击后我想提取查询字符串并用它来查询表格
DB(SQL Server)中的
。存储过程将查询字符串作为

参数,并返回页面将被重定向的实际URL。我可以使用一个按钮来实现这一点,但是我对ASP.NET

超链接的工作很少。我从未使用链接来使用

链接本身的参数查询数据库。我正在使用C#。

有人可以帮我一些代码吗?不要担心DB的东西。我

可以处理。我只需要帮助与超链接相关的代码

(提取查询字符串并使用从SP返回的值作为链接

用于重定向到的页面)。


谢谢,

Hector

I am a novice programmer.
I want to have a hyperlink that looks like so: www.mycoolsite.com?a=21132.
On click I want to extract the query string and use it to query a table
within a DB (SQL Server). The stored procedure takes the query string as a
parameter and returns the actual URL the page is going to be redirectted. I
can do this using a button, but I have done little work with ASP.NET
hyperlinks. I''ve never used a link to query a DB using a parameter from the
link itself. I am using C#.
Can anyone please help me with some code? Don''t worry about the DB stuff. I
can handle that. I only need help with the code associated with the hyperlink
(extracting the query string and using a value returned from a SP as a link
for the page to be redirected to).

Thanks,
Hector

推荐答案

string s = Request .Querystring(");


这里有更多信息:
http://www.dotnetbips.com/displayarticle.aspx?id=79


- -

我希望这会有所帮助,

Steve C. Orr,MCSD,MVP
http://SteveOrr.net

" hecsan07" <他****** @ hotmail.com>在留言中写道

新闻:4D ********************************** @ microsof t.com ...
string s = Request.Querystring("a");

Here''s more info:
http://www.dotnetbips.com/displayarticle.aspx?id=79

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"hecsan07" <he******@hotmail.com> wrote in message
news:4D**********************************@microsof t.com...
我是一名新手程序员。
我希望有一个如下所示的超链接: www.mycoolsite.com?a=21132
点击后我想提取查询字符串并用它来查询表<数据库(SQL Server)中的数据库。存储过程将查询字符串作为
参数,并返回页面将被重定向的实际URL。
我可以使用按钮执行此操作,但我做了很少的工作ASP.NET
超链接。我从未使用链接来使用
链接本身的参数查询数据库。我正在使用C#。
任何人都可以帮我一些代码吗?不要担心DB的东西。
我可以处理它。我只需要帮助处理与
超链接相关的代码
(提取查询字符串并使用从SP返回的值作为
链接
,以便将页面重定向到)

谢谢,
Hector
I am a novice programmer.
I want to have a hyperlink that looks like so: www.mycoolsite.com?a=21132.
On click I want to extract the query string and use it to query a table
within a DB (SQL Server). The stored procedure takes the query string as a
parameter and returns the actual URL the page is going to be redirectted.
I
can do this using a button, but I have done little work with ASP.NET
hyperlinks. I''ve never used a link to query a DB using a parameter from
the
link itself. I am using C#.
Can anyone please help me with some code? Don''t worry about the DB stuff.
I
can handle that. I only need help with the code associated with the
hyperlink
(extracting the query string and using a value returned from a SP as a
link
for the page to be redirected to).

Thanks,
Hector



string s = Request.Querystring(" a");


这里有更多信息:
http://www.dotnetbips.com/displayarticle.aspx?id=79

-

我希望这会有所帮助,

Steve C. Orr,MCSD,MVP
http: //SteveOrr.net

" hecsan07" <他****** @ hotmail.com>在留言中写道

新闻:4D ********************************** @ microsof t.com ...
string s = Request.Querystring("a");

Here''s more info:
http://www.dotnetbips.com/displayarticle.aspx?id=79

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"hecsan07" <he******@hotmail.com> wrote in message
news:4D**********************************@microsof t.com...
我是一名新手程序员。
我希望有一个如下所示的超链接: www.mycoolsite.com?a=21132
点击后我想提取查询字符串并用它来查询表<数据库(SQL Server)中的数据库。存储过程将查询字符串作为
参数,并返回页面将被重定向的实际URL。
我可以使用按钮执行此操作,但我做了很少的工作ASP.NET
超链接。我从未使用链接来使用
链接本身的参数查询数据库。我正在使用C#。
任何人都可以帮我一些代码吗?不要担心DB的东西。
我可以处理它。我只需要帮助处理与
超链接相关的代码
(提取查询字符串并使用从SP返回的值作为
链接
,以便将页面重定向到)。

谢谢,Hector
I am a novice programmer.
I want to have a hyperlink that looks like so: www.mycoolsite.com?a=21132.
On click I want to extract the query string and use it to query a table
within a DB (SQL Server). The stored procedure takes the query string as a
parameter and returns the actual URL the page is going to be redirectted.
I
can do this using a button, but I have done little work with ASP.NET
hyperlinks. I''ve never used a link to query a DB using a parameter from
the
link itself. I am using C#.
Can anyone please help me with some code? Don''t worry about the DB stuff.
I
can handle that. I only need help with the code associated with the
hyperlink
(extracting the query string and using a value returned from a SP as a
link
for the page to be redirected to).

Thanks,
Hector



我不认为你理解我的问题。您发送给我的代码并指出了

来处理请求查询字符串。这是场景:

在我的网站中,我有一个动态超链接。超链接根据某些ID字段从

数据库填充。 DB的一个字段是超链接指向的实际

链接。因此,当我单击自己的超链接时,链接将使用其查询字符串中的值转到数据库,检索该行的URL

字段的值并重定向该URL的用户。

感谢您的帮助,但它只涵盖了我想做的一半。


Hector


" Steve C. Orr [MVP,MCSD]"写道:
I don''t think you understood my problem. The code you sent me and pointed me
to deals with requesting querystrings. This is the scenario:
In my site I have a dynamic hyperlink. The hyperlink is populated from a
database based on some ID field. One of the fields of the DB is the actual
link the hyperlink points to. So when I click my own hyperlink, the link goes
to the DB using the value in its query string, retrieves the value of the URL
field for that row and redirects the user to that URL.
Thank you for your help, but it covers only half of what I want to do.

Hector

"Steve C. Orr [MVP, MCSD]" wrote:
string s = Request.Querystring(" a");

这里有更多信息:
http://www.dotnetbips.com/displayarticle.aspx?id=79

-
我希望这会有所帮助,
Steve C. Orr,MCSD,MVP
http://SteveOrr.net

" hecsan07" <他****** @ hotmail.com>在消息中写道
新闻:4D ********************************** @ microsof t.com。 ..
string s = Request.Querystring("a");

Here''s more info:
http://www.dotnetbips.com/displayarticle.aspx?id=79

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"hecsan07" <he******@hotmail.com> wrote in message
news:4D**********************************@microsof t.com...
我是一名新手程序员。
我希望有一个如下所示的超链接: www.mycoolsite.com?a=21132
点击后我想提取查询字符串并用它来查询表格
一个DB(SQL Server)。存储过程将查询字符串作为
参数,并返回页面将被重定向的实际URL。
我可以使用按钮执行此操作,但我做了很少的工作ASP.NET
超链接。我从未使用链接来使用
链接本身的参数查询数据库。我正在使用C#。
任何人都可以帮我一些代码吗?不要担心DB的东西。
我可以处理它。我只需要帮助处理与
超链接相关的代码
(提取查询字符串并使用从SP返回的值作为
链接
,以便将页面重定向到)。

谢谢,Hector
I am a novice programmer.
I want to have a hyperlink that looks like so: www.mycoolsite.com?a=21132.
On click I want to extract the query string and use it to query a table
within a DB (SQL Server). The stored procedure takes the query string as a
parameter and returns the actual URL the page is going to be redirectted.
I
can do this using a button, but I have done little work with ASP.NET
hyperlinks. I''ve never used a link to query a DB using a parameter from
the
link itself. I am using C#.
Can anyone please help me with some code? Don''t worry about the DB stuff.
I
can handle that. I only need help with the code associated with the
hyperlink
(extracting the query string and using a value returned from a SP as a
link
for the page to be redirected to).

Thanks,
Hector




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

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