Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Click hyperlink, navigateurl to common page and send the text of the hyperlink as a parameter

Posted on 2009-12-20
4
Medium Priority
?
479 Views
Last Modified: 2012-08-14
I want to assume a variable number of hyperlinks, each with a unique name and id that all launch a common aspx file that needs the text of the hyperlink to know what to do in the page load event of the common aspx file. Also how to retrieve that hyperlink text in the page load event of that new page.

Bob
0
Comment
Question by:bob_mechler
  • 2
  • 2
4 Comments
 
LVL 18

Accepted Solution

by:
Rajar Ahmed earned 1500 total points
ID: 26093472
try this mate..
string urltext = "abc,gef,ghi";  //Small demo which has diffvalues 
            string[] demouniqe = urltext.Split(',');
          
            foreach (string eachstring in demouniqe) 
            {
                HyperLink hyp = new HyperLink();
                hyp.Text = eachstring;
                hyp.NavigateUrl = "test.aspx?st=" + eachstring; //Change this to ur page which u need to redirect
                form1.Controls.Add(hyp);                           //Adding Hyperlink Dynamically..
                form1.Controls.Add(new LiteralControl("<br/>")); 
            }
       
//test.aspx.cs
//in page load ::
  if (string.IsNullOrEmpty(Request.QueryString["st"])==false)
        {
            Response.Write("HyperLink Text=" + Request.QueryString["st"]); // this is the code u need to ve in the opening page 
        }

Open in new window

0
 

Author Closing Comment

by:bob_mechler
ID: 31668338
From the sample, I was able to continue searching in the right direction. Thanks,
0
 

Author Comment

by:bob_mechler
ID: 26093562
Being new at ASP.NET it's easier for me to ask questions in context and learn what I need to know about html. The VB.NET part is coming pretty easy since it's more like the programming I've been doing for the last 4 years with the Windows API and VB6
Thanks,
Bob
0
 
LVL 18

Expert Comment

by:Rajar Ahmed
ID: 26093591
Hi Mate .. Ya u will enjoy coding in .net  am sure..!

But Why B ..??With ur question i can able to only direct towards a solution ..As der was no code!
As my solution produced a result for ur task kindly Assign A . !

Meerano3
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question