473,394 Members | 1,697 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Hyperlink help...

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
Nov 19 '05 #1
10 1769
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...
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

Nov 19 '05 #2
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...
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

Nov 19 '05 #3
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");

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


Nov 19 '05 #4
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");

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


Nov 19 '05 #5
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");

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


Nov 19 '05 #6
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");

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


Nov 19 '05 #7
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");

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


Nov 19 '05 #8
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");

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


Nov 19 '05 #9
I did understand your problem and I thought you'd be grateful that I solved
half your problem.
I thought you could figure out the other part, which is simple string
concatenation.
In case I overestimated your skills, here's some code for you to explore
that can solve the other half of your problem.

MyHyperLink.NavigateUrl="Whatever.aspx?MyParameter ="+
Server.UrlEncode(SomeString);

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

"hecsan07" <he******@hotmail.com> wrote in message
news:77**********************************@microsof t.com...
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");

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


Nov 19 '05 #10
I did understand your problem and I thought you'd be grateful that I solved
half your problem.
I thought you could figure out the other part, which is simple string
concatenation.
In case I overestimated your skills, here's some code for you to explore
that can solve the other half of your problem.

MyHyperLink.NavigateUrl="Whatever.aspx?MyParameter ="+
Server.UrlEncode(SomeString);

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

"hecsan07" <he******@hotmail.com> wrote in message
news:77**********************************@microsof t.com...
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");

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


Nov 19 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Marco Krechting | last post by:
Hi All, Sorry but I have to create new message since it cannot find the old message to send a reply. Coming back to this hyperlink thing I will try to explain the real problem cause I think we...
3
by: Kumar | last post by:
Hi Folks, I have a question regarding conditional hyperlink in datagrid. I want to display Hyperlink if my QID values in (1,4,5,6) other wise i want to display just Qdescription with out...
5
by: Martin Dew | last post by:
Having some problems getting a hyperlink object to work in my repeater control, It displays the text I have asked it to for the hyperlink, but it does not act as a link. My repeater code is below...
2
by: Robson Carvalho Machado | last post by:
Dear friends, I'm dynamically creating a Hyperlink with spacer.gif as ImageURL that is an 1px transparent image only to determine link position, but as I create this link dynamically I could not...
1
by: D. Shane Fowlkes | last post by:
Hello All. I keep asking for help with this on the www.asp.net forums and nobody seems to be able to help. What I'm trying to accomplish is very simple. I simply want to create a Hyperlink...
10
by: david | last post by:
Hi, all: I need a help from you about DataGrid control. I created a DataGrid, dg, in design view of .NET visual Stadio and use the builder to add a Hyperlink column to dg. I want to try to assign...
19
by: Joe | last post by:
I have an aspx page (referred to here as page_1) with a datagrid whose first column contains hyperlinks. When a user clicks one of these hyperlinks, he will navigate to another aspx page (referred...
10
by: David Thielen | last post by:
Hi; I have help html pages for each page of my ASP.NET webapp. So for the page datasource.aspx, I have help\datasource.htm. Bu what I want when the hyperlink is clicked, for it to look for the...
6
by: vspsdca | last post by:
Hi, I'm a newbie here and does not really have any formal training on VBA. I just need help to get my hyperlink to work. I have a form in MS Access with a browse button where a user can select a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.