Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Including variable values inline with HTML output

Status
Not open for further replies.

TheDust

Programmer
Aug 12, 2002
217
US
I have a string variable "clientID", with the value of 18 (for example).

I'm trying to include the variable in the .aspx page by including it as such...

<a href=&quot;addContact.aspx?clientID=<%=clientID%>&quot;>

This of course, doesn't work... I know I can do this by assigning the client ID to a literal control, but I'd rather not have so many literal controls scattered all over my .aspx page... does anyone know exactly what I'm doing wrong here?
 
why have a literal control?

Just use an <asp:HyperLink>, and set the value that way:

lnkMyLink.NavigateURL = &quot;addContact.aspx?clientID=&quot; + clientID;

penny1.gif
penny1.gif

The answer to getting answered -- faq855-2992
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top