Link to home
Start Free TrialLog in
Avatar of CipherIS
CipherISFlag for United States of America

asked on

ASP.NET <a href create query string param issue

I am having an issue with my <a href returning a value to dynamically create a query string param.

<a href='mypage.aspx?ID=<%# GetID() %>'>test</a><br />

Open in new window


protected string GetID()
{
    return ViewState["ID"].ToString();
}

Open in new window


when I mouse over it shows as:

http://localhost/mypage.aspx?ID=

I need it to display

http://localhost/mypage.aspx?ID=5

Any ideas?
ASKER CERTIFIED SOLUTION
Avatar of Rajar Ahmed
Rajar Ahmed
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CipherIS

ASKER

@meeran03

When I remove the # it errors.
<a href='mypage.aspx?ID=<%# Eval(GetID()) %>'>test</a><br />