var link = 'http://ipadd.com?uid=" & username & "';
that's a slightly duff solution. writing one language in another is always tricky, but it IS possible to output client-side script from ASP.NET - I'd forget about interspersing it with <% %> though and generate the ENTIRE script server-side, then output that with a registerscriptblock() call (or whatever it is - no patience to check right now.)
But still this is not the solution that I was researching on. I was trying to find a way to put server-side script into a js. Dun think that it is possible anyway, so I had created a aspx page that takes in a querystring and send the user to the correct page.