user728148
user728148

Reputation: 161

create query string in anchor tag

I have an anchor tag in my .aspx page. I want to add a query string to pass the employee ID of the page. I am able to pass the value but it appends a # after the value. Is there a way to remove the # or another way to pass the value?

My code:

 <a class="jt" href="#" rel='WorkExp.aspx?Emplid=<%# Request.QueryString["Emplid"] %>'>
         Previous Work Experience</a></th>                         

When the page is run, I receive WorkExp.aspx?emplid=111111#

I want to remove the # after the employee id.

Thanks,

Upvotes: 2

Views: 12750

Answers (2)

Kev Ritchie
Kev Ritchie

Reputation: 1647

EDIT: After a quick test, you could just remove the rel part of the element and set the href as I suggested before:

<a class="jt" href='WorkExp.aspx?Emplid=<%= Request.QueryString["Emplid"] %>'>Previous Work Experience</a>

If the # still appears at the end, all I can think of is that you are appending this to QueryString somewhere else.

Upvotes: 1

Jason Meckley
Jason Meckley

Reputation: 7591

<a class="jt" href='WorkExp.aspx?Emplid=<%= Request.QueryString["Emplid"] %>'>Previous Work Experience</a>

Upvotes: 6

Related Questions