从表单调用PHP页面的Aspx页面 [英] Aspx page calling php from form

查看:66
本文介绍了从表单调用PHP页面的Aspx页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友,
我有一个aspx页面和html页面..在这里,我正在从我的html页面中复制一个表单,如下所示...由于此表单正在调用php ...我的aspx页面中未应用验证,而提交的验证是html中的wrkng很好..不知道如何进行操作,请帮助..

Hi Friends,
I have one aspx page and html page..Here I am copying one form from my html page as below...Since this form is calling php...The validations are not getting applied in my aspx page While the validation on submit is wrkng fine in html..Dont know how to proceed please help..

<form action="LegalBay.php" method="post" name="LegalBayform" onSubmit="return LegalBay();">

推荐答案

您正在使用客户端验证还是服务器验证?

通过服务器验证,当页面回发时,将检查内容.如果您要对其他页面执行操作,则没有机会执行服务器端验证.

ASP.Net 3及更高版本支持客户端验证".这会将验证脚本加载到网页中,该脚本在客户端中执行而无需回发.以下是有关客户端验证的MSDN文章.

http://msdn.microsoft.com/en-us/library/yb52a4x0 (v = vs.85).aspx [
Are you using client validation or server validation?

With server validation, the content is checked when the page is posted back. Where your action is to a different page, there''s no opportunity to execute the server side validation.

ASP.Net 3 onwards supports "Client-Side Validation". This loads validation scripts into the web page which are executed in the client without posting back. The following is the MSDN article on client validation.

http://msdn.microsoft.com/en-us/library/yb52a4x0(v=vs.85).aspx[^]

A work around would be to post back to your asp.net page so you can validate the form. Then render a redirect page such as this:

<html>
  <head><title>Redirecting</title></head>
  <body onload="document.forms[0].submit();">
    <form action="LegayBay.php" method="post">
      <input type="hidden" name="field1" value="value1" />
      <input type="hidden" name="field2" value="value2" />
    </form>
  </body>
</html>


嘿,我得到了解决方案.实际上,问题是我将该表单粘贴到了另一种表单中,所以只有它不起作用了……现在可以正常工作了...........................................................
Hey I got solution....Actually the problem is I have pasted that form inside another form so only it doesn''t work...Now working fine...


这篇关于从表单调用PHP页面的Aspx页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆