Link to home
Create AccountLog in
Avatar of searchsanjaysharma
searchsanjaysharma

asked on

How to transfer the html content to .aspx page.

I have two controls

<input type='text' id='t1' value=''>
<input type='text' id='t2' value=''>

how to pass to .aspx page and then how to read the values.
Avatar of stergium
stergium
Flag of Greece image

Hello.
Through a form  like this in html .

<form action="http://yourpage.aspx" method="post">
    <input name="TextBox1" type="text" value="" id="t1" />
    <input name="TextBox2" type="text" id="t2" />
    <input type="submit" name="Button1" value="Button" id="Button1" />
</form>

and on the aspx part (reading the values)

<%
response.write(request.querystring("TextBox1"))
response.write(" " & request.querystring("TextBox2"))
%>


hope that helps
Avatar of santhimurthyd
you can use the concept pf querry string to append values in HTML through Javascript and read smae in asp.Net page with Request.QueryString

http://www.codeproject.com/Articles/5876/Passing-variables-between-pages-using-QueryString

Check the blog to pass value between HTML pages like addign and Querrign through Javascript

http://www.dynamicdrive.com/forums/archive/index.php/t-15317.html
ASKER CERTIFIED SOLUTION
Avatar of Loganathan Natarajan
Loganathan Natarajan
Flag of India image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of searchsanjaysharma
searchsanjaysharma

ASKER

This is my html content
I am passing it to default2.aspx, but do i read the values.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

<meta http-equiv="Content-Language" content="en">


<script type="text/javascript" async="" src="cgc_files/ga.js"></script><script type="text/javascript" async="" src="cgc_files/ga.js"></script><script src="cgc_files/swfobject.js" language="javascript"></script>

<link href="cgc_files/style.css" rel="stylesheet" type="text/css">
<link href="cgc_files/form-style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="cgc_files/jquery.js"></script>
<script type="text/javascript" src="cgc_files/jquery.validate.js"></script>
<link type="text/css" media="screen" rel="stylesheet" href="cgc_files/gallery.css">

<script type="text/javascript">
function slideSwitch() {
    var $active = $('#slideshow IMG.active');
    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');
    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow IMG:first');
    // uncomment the 3 lines below to pull the images in random order
    $active.addClass('last-active');
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}
$(function() {
    setInterval( "slideSwitch()", 5000 );
});
</script>
<style type="text/css">
#slideshow {
    position:relative;
    height:312px;
    width:960px;
}
#slideshow IMG {
    position:absolute;
    top:0;
    left:0;
    z-index:8;
    opacity:0.0;
}
#slideshow IMG.active {
    z-index:10;
    opacity:1.0;
}
#slideshow IMG.last-active {
    z-index:9;
}
#Diploma,#Grad,#PostGrad
{visibility:hidden;
display:none;
}

</style>

<script type="text/javascript" src="chrome-extension://dlnembnfbcpjnepmfjmngjenhhajpdfd/resources/LocalScript.js"></script><script type="text/javascript" src="chrome-extension://dlnembnfbcpjnepmfjmngjenhhajpdfd/libraries/DataExchangeScript.js"></script></head>
<body><center>

<div class="main">
      <div class="container">
             
        <div class="flash">
                  <div class="text-other">
<script type="text/javascript">
function captcha()
{
      if(document.getElementById("CAPTCHA1").value!="0" && document.getElementById("CAPTCHA1").value!="")
      {
            document.getElementById("ECAPTCHA1").innerHTML="<span style='color:#c00;font-variant:small-caps;font-weight:bold;border-top:1px dotted #ccc;'>you have entered a wrong result. Please enter a correct result.</span>";
            document.getElementById("CAPTCHA1").focus();
            return false;
      } else {
            document.getElementById("ECAPTCHA1").innerHTML="";
      }
}

function others()
{
      var data = document.getElementById('FROMWHERE').value;
      if(data=="Others")
      {
            document.getElementById('otherdiv').style.visibility='visible';
            document.getElementById('otherdiv').style.display='block';
      } else {
            document.getElementById('otherdiv').style.visibility='hidden';
            document.getElementById('otherdiv').style.display='none';
      }
}
function others1()
{
      var data = document.getElementById('Edu').value;
      if(data=="Any Other")
      {
            document.getElementById('otherdiv1').style.visibility='visible';
            document.getElementById('otherdiv1').style.display='block';
      } else {
            document.getElementById('otherdiv1').style.visibility='hidden';
            document.getElementById('otherdiv1').style.display='none';
      }
}
function oth()
{
      var data = document.getElementById('DType').value;
      if(data=="Diploma")
      {
            document.getElementById('Diploma').style.visibility='visible';
            document.getElementById('Diploma').style.display='block';
            document.getElementById('Grad').style.visibility='hidden';
            document.getElementById('Grad').style.display='none';
            document.getElementById('PostGrad').style.visibility='hidden';
            document.getElementById('PostGrad').style.display='none';
      }
      else if (data=="Grad")
      {      document.getElementById('Grad').style.visibility='visible';
            document.getElementById('Grad').style.display='block';
            document.getElementById('Diploma').style.visibility='hidden';
            document.getElementById('Diploma').style.display='none';
            document.getElementById('PostGrad').style.visibility='hidden';
            document.getElementById('PostGrad').style.display='none';
      
      }
      else if (data=="PostGrad")
      {      document.getElementById('PostGrad').style.visibility='visible';
            document.getElementById('PostGrad').style.display='block';
            document.getElementById('Diploma').style.visibility='hidden';
            document.getElementById('Diploma').style.display='none';
            document.getElementById('Grad').style.visibility='hidden';
            document.getElementById('Grad').style.display='none';
      
      }
      function enableDisableButton() {
                button = document.getElementById("Submit");
                button.disabled = !button.disabled;
        }
}

</script>
<br>
<h1>Admission Registration Form</h1>
<div id="matched">
<form id="login" class="form" onsubmit="return captcha();"  action="Default2.aspx" method="post" name="login" runat="server">
<fieldset>
      <legend><b>Personal Details</b></legend><br>
      <table border="0" cellpadding="0" cellspacing="0" width="100%">
            <tbody><tr>
                  <td class="">
                        <label for="NAME"><span class="required">Name</span></label>
                        <input id="NAME" name="NAME" class="text required error" type="text">
                        <label for="NAME" generated="true" class="error" style="display: inline;">This field is required.</label>
                  </td>
            </tr>
            <tr>
                  <td>
                        <label for="FNAME"><span class="norequired">Father's Name</span></label>
                        <input id="FNAME" name="FNAME" class="text norequired" type="text">
                  </td>
            </tr>
            <tr>
                  <td>
                        <label for="ADDRESS"><span class="norequired">Address</span></label>
                        <textarea rows="4" cols="35" id="ADDRESS" name="ADDRESS" class="text norequired"></textarea>
                  </td>
            </tr>
            <tr>
                  <td class="">
                        <label for="CONTACTNO"><span class="required">Contact No</span></label>
                        <input id="CONTACTNO" name="CONTACTNO" class="text required number error" minlength="10" type="text">
                        <label for="CONTACTNO" generated="true" class="error" style="display: inline;">This field is required.</label>
                  </td>
            </tr>
            <tr>
                  <td class="">
                        <label for="LANDLINETNO"><span class="required">LANDLINE No</span></label>
                        <input id="LANDLINENO" name="LANDLINENO" class="text required number error" minlength="10" type="text">
                  </td>
            </tr>
            <tr>
                  <td class="">
                        <label for="EMAIL"><span class="required">Email</span></label>
                        <input id="EMAIL" name="EMAIL" class="text required email error" type="text"><label for="EMAIL" generated="true" class="error" style="display: inline;">This field is required.</label>
                  </td>
            </tr>
            <tr>
                  <td>
                        <label for="Edu"><span class="norequired">Select Your Higher Education</span></label>
                        <select id="Edu" name="Edu" class="text norequired" onchange="others1(); return false;">
                              <option value="">-- Select --</option>
                              <option value="Matric">Matric</option>
<option value="10+2(Medical)">10+2(Medical)</option>
<option value="10+2(N.Medical)">10+2(N.Medical)</option>
<option value="10+2(Any Stream)">10+2(Any Stream)</option>
<option value="ITI">ITI</option>
<option value="Diploma in Engg.">Diploma in Engg.</option>
<option value="Graduation(Any Stream)">Graduation(Any Stream)</option>
<option value="Graduation any Stream">Graduation any Stream</option>
<option value="B. Sc (N.Medical)">B. Sc (N.Medical)</option>
<option value="B.Sc(Medical)">B.Sc(Medical)</option>
<option value="B.Sc(Pharmacy)">B.Sc(Pharmacy)</option>
<option value="B.Sc(Any Other)">B.Sc(Any Other)</option>
<option value="B.Tech/BE">B.Tech/BE</option>
<option value="Any Other">Any Other</option>

                        </select>
                        <div id="otherdiv1" style="visibility:hidden;display:none;">
                              <label for="Edu"><span class="norequired">If Other</span></label>
                              <input id="OTHER2" name="OTHER2" class="text norequired" type="text" >
                              </div>
                  </td>
            </tr>

      <tr>
                  <td class="">

<label for="per1"><span class="norequired">Result Status</span></label>
<input type="radio" name="res" value="Awaited" checked="checked" onclick="document.getElementById('rep2').style.display='none';"> Awaited<input type="radio" name="res" value="Passed" onclick="document.getElementById('rep2').style.display='block';"> Passed
<br>
<div id="rep2" style="display:none">
<label for="per" ><span class="norequired">Persentage</span></label>
<input id="per" name="per" class="text norequired" type="text" >
</div>
                  </td>
            </tr>      
</tbody></table>
</fieldset>
<br>

<fieldset>
<legend><b>Course Interested In </b></legend>
<br>
      <table border="0" cellpadding="0" cellspacing="0" width="100%">
            <tbody><tr>
                  <td>
                        <label for="DType"><span class="norequired">Course Type</span></label>
                        <select id="DType" name="DType" class="text norequired" onchange="oth();">
                              <option value="">-- Select --</option>
                              <option value="Diploma" >Diploma Courses</option>
                              <option value="Grad">Graduation Courses</option>
                              <option value="PostGrad">Post Graduation Courses</option>
                        </select>
                  </td>
            </tr>
</tbody></table>

</fieldset>
<br />
<fieldset id="Diploma">
      <legend><b>Options after Xth (You can select multiple choices)</b></legend><br>
      
      <table border="0" cellpadding="0" cellspacing="0" width="100%">
            <tbody><tr>
                  <td>
                        <label for="DCOURSE"><span class="norequired">Diploma Course</span></label>
                        <select id="DCOURSE" name="DCOURSE" class="text norequired" multiple="">
                              <option value="Computer Science Engineering (CSE)">Computer Science Engineering (CSE)</option>
<option value="Mechanical Engineering (ME)">Mechanical Engineering (ME)</option>
<option value="Electronics and Communication Engineering (ECE)">Electronics and Communication Engineering (ECE)</option>
<option value="Civil Engineering (CE)">Civil Engineering (CE)</option>
<option value="Electrical Engineering (EE)">Electrical Engineering (EE)</option>
<option value="Automobile Engineering(AME)">Automobile Engineering(AME)</option>
<option value="Mechanical Engineering (Tool & Die Specialization)">Mechanical Engineering (Tool & Die Specialization)</option>

                        </select>
                  </td>
            </tr>
</tbody></table>
</fieldset>

<fieldset id="Grad">
      <legend><b>Options after XIIth (You can select multiple choices)</b></legend><br>
      <table border="0" cellpadding="0" cellspacing="0" width="100%">
            <tbody><tr>
                  <td>
                        <label for="GCOURSE"><span class="norequired">Graduate Course</span></label>
                        <select id="GCOURSE" name="GCOURSE" class="text norequired" multiple="">
                              <option value="Computer Science Engineering (CSE)">Computer Science Engineering (CSE)</option>
<option value="Mechanical Engineering (ME)">Mechanical Engineering (ME)</option>
<option value="Electronics and Communication Engineering (ECE)">Electronics and Communication Engineering (ECE)</option>
<option value="Electrical and Electronics Engineering (EEE)">Electrical and Electronics Engineering (EEE)</option>
<option value="Civil Engineering (CE)">Civil Engineering (CE)</option>
<option value="Computer Science and Communication Engineering (CCE)">Computer Science and Communication Engineering (CCE)</option>
<option value="Electrical Engineering (EE)">Electrical Engineering (EE)</option>
<option value="Automobile Engineering(AME)">Automobile Engineering(AME)</option>
<option value="Chemical Engineering (CHE)">Chemical Engineering (CHE)</option>
<option value="Petrochem & Petroleum Refinery Engineering (PPRE)">Petrochem & Petroleum Refinery Engineering (PPRE)</option>
<option value="BCA">BCA</option>
<option value="B. Arch.">B. Arch.</option>
<option value="B.Sc Hotel Management & Catering Technology (HMCT)">B.Sc Hotel Management & Catering Technology (HMCT)</option>
<option value="B.Sc -Airlines, Tourism & Hospitality Management (ATHM)">B.Sc -Airlines, Tourism & Hospitality Management (ATHM)</option>
<option value="BSc. A&MT">BSc. A&MT</option>
<option value="BBA">BBA</option>
<option value="B.Com (Honours)">B.Com (Honours)</option>
<option value="BSc. Bio-Tech.">BSc. Bio-Tech.</option>

                        </select>
                  </td>
            </tr>
</tbody></table>
</fieldset>
<fieldset id="PostGrad">
      <legend><b>Options after Graduation(You can select multiple choices)</b></legend><br>
      <table border="0" cellpadding="0" cellspacing="0" width="100%">
            <tbody><tr>
                  <td>
                        <label for="PGCOURSE"><span class="norequired">Post Graduate Course</span></label>
                        <select id="PGCOURSE" name="PGCOURSE" class="text norequired" multiple="">
                        <option value="MCA (Integrated)  ">MCA (Integrated)  </option>
<option value="B. Hotel Mgmt & Catering Technology + MBA (Integrated)">B. Hotel Mgmt & Catering Technology + MBA (Integrated)</option>
<option value="BBA+MBA (5 Yrs.) Integrated ">BBA+MBA (5 Yrs.) Integrated </option>

                        <option value="Electrical Engineering (EE)">Electrical Engineering (EE)</option>
<option value="Computer Science Engineering (CSE)">Computer Science Engineering (CSE)</option>
<option value="Electronics and Communication Engineering (ECE)">Electronics and Communication Engineering (ECE)</option>
<option value="Information Technology (IT)">Information Technology (IT)</option>
<option value="Mechanical Engineering (ME)">Mechanical Engineering (ME)</option>
<option value="Electrical Engineering (EE) Honrs">Electrical Engineering (EE) Honrs</option>
<option value="Computer Science Engineering (CSE) Honrs">Computer Science Engineering (CSE) Honrs</option>
<option value="Electronics and Communication Engineering (ECE) Honrs">Electronics and Communication Engineering (ECE) Honrs</option>
<option value="Mechanical Engineering (ME) Honrs">Mechanical Engineering (ME) Honrs</option>
<option value="MCA ">MCA </option>
<option value="MBA (Tourism & Hospitality Management) ">MBA (Tourism & Hospitality Management) </option>
<option value="MSc. A&MT">MSc. A&MT</option>
<option value="MBA( Specialization: - Marketing/ Human Resource/ Finance/IT)">MBA( Specialization: - Marketing/ Human Resource/ Finance/IT)</option>
<option value="MBA  (International Business)">MBA  (International Business)</option>
<option value="MSc. Bio-Tech.">MSc. Bio-Tech.</option>
<option value="M.A. Punjabi">M.A. Punjabi</option>
<option value="M.A. English">M.A. English</option>

                        </select>
                  </td>
            </tr>
</tbody></table>
</fieldset>

<br>
<fieldset>
      <legend><b>Your Achievements</b></legend><br>
      <table border="0" cellpadding="0" cellspacing="0" width="100%">
            <tbody><tr>
                  <td>
                        <label for="ACADEMIC"><span class="norequired">Academic</span></label>
                        <input id="ACADEMIC" name="ACADEMIC" class="text norequired" type="text">
                  </td>
            </tr>
            <tr>
                  <td>
                        <label for="SPORTS"><span class="norequired">Sports</span></label>
                        <input id="SPORTS" name="SPORTS" class="text norequired" type="text">
                  </td>
            </tr>
            <tr>
                  <td>
                        <label for="ACTIVITY"><span class="norequired">Extra Curricular Activities</span></label>
                        <input id="ACTIVITY" name="ACTIVITY" class="text norequired" type="text">
                  </td>
            </tr>
</tbody></table>
</fieldset>
<fieldset>
      <legend><b>From where did you know about CGC/CU</b></legend><br>
      <table border="0" cellpadding="0" cellspacing="0" width="100%">
            <tbody><tr>
                  <td>
                  <table border="0" cellpadding="0" cellspacing="0" width="100%">
                        <tbody><tr>
                              <td>
                        <label for="FROMWHERE"><span class="required"></span></label>
                        <select id="FROMWHERE" name="FROMWHERE" class="text required error" onblur="others(); return false;" onchange="others(); return false;">
                              <option value="">-- Select --</option>
                              <option value="Newspaper Advt.">Newspaper Advt.</option>
                              <option value="Radio Advt.">Radio Advt.</option>
                              <option value="Online Search Engine">Online Search Engine</option>
                              <option value="Career Counselling Program">Career Counselling Program</option>
                              <option value="Others">Others</option>
                        </select><label for="FROMWHERE" generated="true" class="error" style="display: inline;">This field is required.</label>
                              </td>
                        </tr>
                        <tr>
                              <td>
                              <div id="otherdiv" style="visibility:hidden;display:none;">
                              <label for="FROMWHERE"><span class="norequired">If Other</span></label>
                              <input id="OTHER1" name="OTHER1" class="text norequired" type="text" >
                              </div>
                              </td>
                        </tr>
                        </tbody></table>
                  </td>
            </tr>
</tbody></table>
</fieldset>
<br>
<fieldset>
      <legend><b>Please calculate to enter the correct result</b></legend><br>
      <table border="0" cellpadding="0" cellspacing="0" width="100%">
            <tbody><tr>
                  <td>

<label for="CAPTCHA1"><span class="norequired"><input type="text" name="captchaImage" size="6" value="5-5" disabled="disabled"></span></label>
<input type="text" id="CAPTCHA1" name="CAPTCHA1" class="text required error" size="6" maxlength="6"><label for="CAPTCHA1" generated="true" class="error" style="display: inline;">This field is required.</label> &nbsp; Please enter the correct result.<br>
<label for="CAPTCHA1"><span class="norequired">&nbsp;</span></label>
<span id="ECAPTCHA1"></span>

</td>
            </tr>
</tbody></table>
</fieldset>
<br>
<input type="checkbox" onClick="document.login['Submit'].disabled =(document.login['Submit'].disabled)? false : true"> I Hare by confirm that all the entries are correct.<br />

<input type="submit" value="Submit" name="Submit" style="cursor:hand;margin-left:0px;" disabled="disabled" >
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</form>
</div><br>

                  </div>
        </div>
            
            
      </div>
</div>
</center><div id="LCS_336D0C35_8A85_403a_B9D2_65C292C39087_communicationDiv"></div></body></html>