PDA

View Full Version : How to open asp page without loading the code


VMM
07-26-2005, 01:28 PM
Hello,

I have tried to find a way to open an asp page ,that gets information from the database, without it loading the whole code at the same time. I haven't found such an information.

I have a text box in the beginning of the page. The user writes some text in it and the program gets information from the db based on what the user wrote to the text box.

Now, the DB is huge and when I open the page all the information are printed to the page. I have tried to get it work in such a way that when the page is opened..only the text box is shown in the page.

The text box is in the same page like the rest of the code, but it is in different form.

How can I get the code stopped before it goes in to the DB?

jaywhy13
07-26-2005, 06:37 PM
response.end?

Basscyst
07-28-2005, 01:06 AM
I gather when the page loads the string you are searching by is empty and just returns all records? If that's the case, you have to put in a check to see if the form has been submitted or not.

Something like:

<%
If Trim(Request.Form("search")) <> "" Then
Your DB code here.
End If
%>
<form method="post">
<input type="text" name="search">
<input type="submit">
</form>


Basscyst

debo602
07-28-2005, 04:43 PM
check you SQL statement. you can end it once you get to many rows.

or you could create a check on your recordset retrieval to stop retrieval and create a second page.

oracleguy
07-28-2005, 05:39 PM
or you could create a check on your recordset retrieval to stop retrieval and create a second page.

Yeah, database paging might work for you there depending on what you are doing exactly.

VMM
07-29-2005, 09:21 AM
Hello,

and thank you very much for good advices. The purpose was just to stop the loading of the page if the text Boxes are empty. So the if condition and the response.end did the work very well.

if textbox1 = "" then response.end