blitzkrieg bop Posted November 1, 2003 Posted November 1, 2003 One last question and I'll have my old asp page converted: How can I convert the following old asp code? I need to put this logic in my code-behind page. <form name="frmSearch" method="post" action=" <% if dbCustID = "" then response.write ("/searchresults.asp") else response.write ("/searchresults.asp?customerID=" & dbCustID) end if %>" onsubmit="return chkSearch(this)"> Tried using label and can't get that to work Thanks Quote
blitzkrieg bop Posted November 2, 2003 Author Posted November 2, 2003 I believe I need to handle it this way: <form id="frmSearch" runat="server" onsubmit="return chkSearch(this)"> <input type="text" name="keyword" size=14 maxlength=50 value="Search here..."> <input type="image" src="/_images/header_go.gif" border="0" alt="Search"></form> And I added this in my ascx.vb: If IsPostBack Then Response.Redirect("/searchresults.asp" + strCustID, True) End If My problem is that in searchresults.asp I have the following code which will not work since I'm doing a redirect from the ascx.vb: lvKeyword = trim(request.form("keyword") I don't want to put this value in a querystring. How can I post to searchresult.asp like I did before? Thanks Quote
*Gurus* Derek Stone Posted November 2, 2003 *Gurus* Posted November 2, 2003 You can't submit (POST) to another page using a server-side form in this version of ASP.NET. Either use a HTML form, which doesn't run on the server-side (e.g. no "runat" attribute), or re-work your code to postback to the same page, as is the intended behavior of the ASP.NET model. Quote Posting Guidelines
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.