I'm finding it very difficult to understand what you are asking or what you are trying to do. I wonder if you need more information on how data and process flows in ASP. Hopefully the following thoughts will help a bit ...
1) The ASP code in your file is processed and finished before your generated page goes to your browser. Once you get your page on the browser, the ASP code no longer exists as a process - you cannot return to it. If you reload the page, it will run a new copy of the ASP code. 2) Your target file "searchstudent.asp" will be called when the submit button is clicked. The ASP code in this file will be run on the server and can process the information from the "studno" form in any way it likes. This can include looking up a database and/or updating data into a database; generating information for a page to go to the browser; acting on information in the form to do a response.redirect to direct the server to a different ASP file. 3) The ASP code in "searchstudent.asp" can generate HTML for your browser. This might be interspersed with embedded HTML in the file, and possibly even some embedded JavaScript in the file. Once this is all done, the ASP execution will finish, and the lot will be shipped to your browser to be treated as an HTML page. No more ASP will be run on the server for execution of this file. 4) In ASP, there is no such thing as a main program. In fact, there isn't really anything you could call a program. Each file simply contains code that is executed as a unique piece of code by the server. Hope this isn't more confusing than helpful, but you need to get your head around the process flow. To put it in perspective ... Something causes the server to send your page to the browser. Some ASP might be involved in this - I don't know, as you haven't shown that code. The server then "forgets" about the file that held your page. You submit your form, and this asks the server to execute "searchstudent.ASP". ASP code in "searchstudent.ASP" is used to retrieve the information from the form. It then does whatever is required to generate HTML for transmission to the user as a browser page. The server then "forgets" about the form and the file "searchstudent.ASP". The browser receives and displays the generated HTML, then sits and waits for the user to do something. If you use response.redirect, you can indeed redirect the server to your original file. However, this is to a completely new execution of this file - nothing is left from the first execution. Have a look at some ASP books or tutorials - they will hopefully agree with me :-) and lead you through some simple examples. Dave S ----- Original Message ----- From: Srikant Sharma To: [email protected] Sent: Saturday, September 03, 2005 2:29 PM Subject: [ASP] Redirect Method I have two variables in my page: <form action="searchstudent.asp"> Student No:<input type="text" name="studno"> Department Name:<input type="text" name="depname"> <input type="submit" value="Search"> </form> Now when I press the button and it goes to searchstudent.asp file and do some process to find the student no. After process i find values in mstudno, mdeptname now i want to move these values into my main program from where i call searchstudent.asp file. How to i move them as i dont want any button in the searchstudent.asp file i want that these values automatically move to the original file. There is one method response.redirect. How to i use this method with values or is their any other method, PLEASE HELP Thanks, __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com [Non-text portions of this message have been removed] --------------------------------------------------------------------- Home : http://groups.yahoo.com/group/active-server-pages --------------------------------------------------------------------- Post : [email protected] Subscribe : [EMAIL PROTECTED] Unsubscribe: [EMAIL PROTECTED] --------------------------------------------------------------------- SPONSORED LINKS Active server page web hosting Active server page hosting Active server pages Active server page asp Active server page training ------------------------------------------------------------------------------ YAHOO! GROUPS LINKS a.. Visit your group "active-server-pages" on the web. b.. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. ------------------------------------------------------------------------------ [Non-text portions of this message have been removed] ------------------------ Yahoo! Groups Sponsor --------------------~--> Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life. http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/17folB/TM --------------------------------------------------------------------~-> --------------------------------------------------------------------- Home : http://groups.yahoo.com/group/active-server-pages --------------------------------------------------------------------- Post : [email protected] Subscribe : [EMAIL PROTECTED] Unsubscribe: [EMAIL PROTECTED] --------------------------------------------------------------------- Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/active-server-pages/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
