Click here to Skip to main content
15,885,669 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I have url like this
www.codeproject.com/Questions/ask.aspx?Ques=200
Ques is dynamic
i want to use this ques in another url as href
using html

What I have tried:

HTML
<a href="../ISReports/TeachersList.aspx?Inst_code=%20@Ques"></a>
Posted
Updated 22-Oct-17 20:10pm
v2

1 solution

try this,

Read the query string value from url[^] and append the value to the url.
use onclick event to call the javascript function to navigate to the link with modified query string.
<a onclick="goToLink()" href="#">Link Name</a>

function goToLink() {
          var url = '../ISReports/TeachersList.aspx?Inst_code=';
          var ques = getParameterByName('Ques');
          url = url + ques;
          window.location = url;
      }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900