Click to See Complete Forum and Search --> : Remote Searching from Html to ASPX page


tparrish
09-03-2003, 02:18 PM
Please help me find a javascript to accept a user value from a textbox and receive the value into a aspx default.aspx web page textbox.

The situation is the remote search textbox on on a HTML page and the value needs to be passed to another url that contains default.aspx in that textbox.

Below is my sample HTML

<html>
<head>
<title>MYFAU - Search FAU Phonebook</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
function passName(){
var name = "<html><head><title>My FAU Phone/Email</title></head>" +
"<body><h1> MyFAU Phone/Email</h1><p>" +
document.phonebook.username.value + "</p></body></html>";
pnameWin = window.open("", "phonebook", "width=400,height=250,scrollbars=yes");
pnameWin.document.write(name);
pnameWin.document.close();
}
</script>

</head>

<body bgcolor="#FFFFFF" text="#000000">

<table cellpadding=3 cellspacing=0 border=0 bgcolor="#ffffff" height="55" width="201">
<tr>

<td height="36">
<!--<form target="_blank" method="POST" action="http://aura.irm.fau.edu/cgi-bin/edir/edsearch.sh" name="phonebook">-->
<form name="phonebook">
<font face="Arial, Helvetica, sans-serif" size="1">Enter as <i> Last Name,
First Name</i></font><br>
<input name="username" type="txt" size=25>
<br>
<input type="button" value="Lookup Name" onClick="passName();">
<input type="reset" value="Reset" name="reset">
<input name="intv" type="hidden" value="0">
<a href="/searchpage/termsofuse.html" target="_blank"><font face="Arial, Helvetica, sans-serif" size="1">Terms
of Use</font></a>
</form>
</td>
</tr>
</table>
</body>
</html>

PeOfEo
09-04-2003, 07:13 PM
Why not make the page in asp.net instead of trying to pass the value over to an asp.net page from an html page, it would be easyer that way, just do the form objects in asp.net and the rest of your page is reqular old html. The only two ways I can think to pass a value from a java script page to asp.net are either using ajava script redurect to the asp.net page but putting a ?something=something query string in the url, or useing a cookie.

tparrish
09-05-2003, 06:41 AM
That is what I thought. I will create a new ASP.Net page with the search text box that will redirect the passed value into the receiving apsx page to display the search results in a datagrid.

Thanks for the help!:)

PeOfEo
09-05-2003, 06:58 PM
You might even try seeting the data grid or list visible="false" but when you click the command button your data grid or list or whatever you are displaying the reasults in would be the set to visible="ture" and all of the stuff that you dont want to be there anymore could be visible="false", It will look like a redirect to the user, but really its just way of putting all the code in one file. I would probably go with the redirect and use a query string, it would probably be the mose efficient but, I just thought I would present another option.

tparrish
09-08-2003, 06:40 AM
Thank you for the ideas. I will try some code that you suggested.

PeOfEo
09-08-2003, 11:26 PM
No prob, Anytime. I am still learning asp.net myself but if you ever have a question feel free to send me a pm or something.