문제

I'm using ASP.NET web forms and i need to post data to an iframe, the problem is that in web forms I have the main form tag(form1), so i need another form tag(form2), to post data to the iframe that is in the main form1.

Basically i have this:

<form method="post" id="form2" action="http://localhost:58903/WebForm1.aspx" target="webApp">
    <input type="hidden" name="ValidationUserName" value="david" />
    <input type="hidden" name="ValidationTokenId" value="13123132132" />
    <button type="submit">Send info to inner iframe</button>
</form> 

    <form id="form1" runat="server">
            <iframe id="webApp" name="webApp" src="http://localhost:58903/WebForm1.aspx" style="width: 800px; height: 800px;"></iframe>
        </form>

With this approach in open a new tab, if i put the iframe outside it works ok, but if i do this the layout is changed and i don't want this.

Is this possible?

도움이 되었습니까?

해결책 2

Done it, it was missing the "name" attribute in the <form> tags.

다른 팁

If all the forms are in the same domain you should not work with iframes. What exactly are you trying to get here? didn't realize completely

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top