开发者

post a <FORM> to sharepoint page

开发者 https://www.devze.com 2023-04-13 06:50 出处:网络
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>

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?


posting 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:

  1. create a separate .aspx page entirely to produce the form
  2. open that form from within your Web Part with a JS call to window.open or an <a href="..." target="blank"
  3. 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.)

0

精彩评论

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

关注公众号