473,803 Members | 3,159 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
10 1809
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.Nav igateUrl="Whate ver.aspx?MyPara meter="+
Server.UrlEncod e(SomeString);

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

"hecsan07" <he******@hotma il.com> wrote in message
news:77******** *************** ***********@mic rosoft.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.Queryst ring("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******@hotma il.com> wrote in message
news:4D******** *************** ***********@mic rosoft.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
4399
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 are going in circles. I have a continous form with a hyperlink field on it. Normally when you click on a hyperlink field Access will follow the Hyperlinkbase set in the database. This is for example in my case "I:\". However I have two different
3
2603
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 hyperlink. <asp:hyperlinkcolumn headertext="Question" SortExpression="QDescription" datatextfield="QDescription"
5
6692
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 but here is the snippet of my asp:hyperlink object; <asp:HyperLink NavigateUrl="authonly/clientdetails.aspx?searchID="+<%#DataBinder.Eval(Conta iner.DataItem,"CLIENTREF")%> ID="Hyperlink1"><%#DataBinder.Eval(Container.DataItem,...
2
6771
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 set image width. This problem makes my link clickable only on its borders. When viewing HTML source I could see that spacer.gif has no width and height, so HTML shows only 1px x 1 px image.
1
1873
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 Column in a Datagrid and reformat the text output of the column. The helper function seems to be working but the hyperlink column isn't properly being render into html. The actual hyperlink web control is showing up in the html when tested on two...
10
1946
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 a column of URLs to this hyperlink column in programming way (ie., dynamically assignment). However, I can not find a way to continue doing it. Do you have ideas about it? Thanks.
19
3562
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 to here as page_2). I need to cache the value of the link's text (hyperlink.text property) so that I can use it in the page_load event of page_2. I've thought of using a hidden field and then calling Request.Form("hdnClickedLinkText") in the...
10
2297
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 following files in order (assuming I am running from the us): help\datasource_en_US.htm help\datasource_en.htm help\datasource.htm
6
5679
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 folder from a specified directory from our network. I was able to get the browse button working where it saves a path that is selected onto the textbox that is set as hyperlink. The problem appears when you click on the hyperlink... it will work a few...
0
9700
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10546
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10310
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10068
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5498
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5627
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4275
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3796
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2970
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.