更新时间:2023-12-03 10:20:52
从客户端,您可以访问它:document .getElementById( myForm)。action
或document .forms [ 0 ]。action
(大多数页面都有单一表格但如果你有更多的调整索引!)
从服务器端可以这样做:MyPage.Form.Action
I am using following file uploader in asp.net page "https://github.com/blueimp/jQuery-File-Upload"
FileUpld.aspx page :
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div id="fileupload">
<form action="../WebServices/SFileUpload.ashx" method="POST" enctype="multipart/form-data" >
MasterPage :
<body>
<form id="form1" runat="server" >
Here as you can see master page and .aspx page both contains form tag. I want to access "action" of <form> from .aspx page. But when I am trying to do the same, its searching in master page for "action". Above .aspx page inherits same master page. Can anyone please tell me how can I access "SFileUpload.ashx" ?
From the client side you can access it like:document.getElementById("myForm").action
ordocument.forms[0].action
(Most pages hav a single form but if you have more adjust index!)
From the server side it can be done like this:MyPage.Form.Action