开发者

Run asp script and return to original page

I've been looking for a while but i haven't bee开发者_开发百科n able to do this. I'm submitting a form to a asp script but i want to know if it's possible to either just run the script from the original page or if it's possible to make it return to the original page.

Is there a simple solution to this problem?


Two ways immediately spring to mind:

1) Convert your form to an ASP page. If the form is just HTML/JavaScript, simply change the file name to filename.asp. Then in your form tags call the filename, e.g.

<form name="form1" action="filename.asp" method="post">

At the top of filename.asp (or better still, use an include file) insert your script:

<% if request.form.count > 0 then
   ...
   end if %>

When the user submits the form they will see the original form but you can display feedback to the user or hide the form on submit.

2) Make sure your ASP script doesn't print anything to the page and at the end of the script add

response.redirect("original-page")  
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜