I am doing following in one of my webpart .ascx file.
<FORM action="https://illustration.sagicorlifeusa.com/fse5/main/FormPost.aspx" id="frmLogin" method="post" target=blank>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<%= CompleteRequest %>
<input type="submit" name="__exclude__Submit" value="Run Sagicor Life Illustration So开发者_Python百科ftware Online" />
Notice the method="post"; However, looks like when I add this web-part, The hosting page already has a <FORM/>
. How can I do the above POST?
post
ing to a new window from inside an ASPX web form (which SharePoint is) is tricky, because the framework wraps everything in a <form>
it keeps track of. If you are required to post to the target page (i.e. get
isn't good enough), you might have to:
- create a separate .aspx page entirely to produce the form
- open that form from within your Web Part with a JS call to
window.open
or an<a href="..." target="blank"
- auto-post that form, with JavaScript, as soon as it loads.
(I have no firsthand experience with sharepoint; take this answer with a grain of salt.)
精彩评论