如何访问“动作”在使用母版页的asp.net页面上的表单标签上 [英] How to access "action" on form tag in asp.net page which uses master page
问题描述
我在asp.net页面使用以下文件上传器https://github.com/blueimp/jQuery-File-Upload
FileUpld.aspx页面:
< asp:Content ID = Content2 ContentPlaceHolderID = < span class =code-keyword> ContentPlaceHolder1 runat = server >
< div id = fileupload >
< 表格 action = ../ WebServices / SFileUpload.ashx 方法 = POST enctype = multipart / form-data >
MasterPage:
< 正文 >
< 表格 id = form1 runat = server >
这里您可以看到母版页和.aspx页都包含表格标签。我想访问< form>的动作来自.aspx页面。但是当我试图做同样的事情时,它在母版页中搜索动作。以上.aspx页面继承了相同的母版页。任何人都可以告诉我如何访问SFileUpload.ashx?
从客户端,您可以访问它:
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
or
document.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
这篇关于如何访问“动作”在使用母版页的asp.net页面上的表单标签上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!