Some very simple asp

Posted on 2013-10-11
Medium Priority
Last Modified: 2013-10-12
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">
<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="$/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;">

Open in new window

Question by:soozh
LVL 38

Assisted Solution

by:Tom Beck
Tom Beck earned 1000 total points
ID: 39565108
Maybe this:

<input type="hidden" id="username" name="username" value='<%= Request.ServerVariables["IDP_USERNAME"] %>'>
LVL 34

Accepted Solution

Big Monty earned 1000 total points
ID: 39565704
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>

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Strategic internal linking is often considered an SEO power technique, especially for content marketing. Do you need to hire an SEO agency to optimize you internal linking? No, this article will help you understand the basics of internal linking and…
Before you approach an Ionic Mobile App development company for developing mobile apps using the ionic framework, you must know why you should choose the framework. Let's try to understand that through this article.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Suggested Courses

600 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question