Some very simple asp

I am not an asp expert but i think the following code is simple?

I would like to be able to put the value of the variable "username" in the hidden field "username".  If you look at the code i have written : want the value of username here!!

How can i do this?  I keep getting compiler errors.  Should be easy for anyone who knows asp.

<%@ page language="C#" autoeventwireup="true" Debug="true" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body onLoad="javascript:window.parent.document.forms[0].submit();">

<%
 // Get the login variables
  string username = Request.ServerVariables["IDP_USERNAME"] ;
  string email = Request.ServerVariables["IDP_EMAIL"] ;
  string uid = Request.ServerVariables["IDP_UID"] ;

%>

 <form id="form1" action="http://79.171.249.41/RT/RequestTest.dll/$/Start/" method="POST">
   <input type="hidden" id="username" name="username" value="want the value of the variable username here!!"><br>
   <input type="hidden" name="email" value="richard@bibby"><br>
   <input type="hidden" name="uid" value="123456"><br>

   <input type="submit" value="Submit" style="position: absolute; left: -9999px; width: 1px; height: 1px;">
 </form>
 
</body>
</html>

Open in new window

soozhCEOAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Tom BeckCommented:
Maybe this:

<input type="hidden" id="username" name="username" value='<%= Request.ServerVariables["IDP_USERNAME"] %>'>
0
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
if you want the variable username to appear in the hidden field, ylou would use the <%= %> syntax:

<input type="hidden" id="username" name="username" value="<%=userName%>"><br>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.