Question

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?

Was it helpful?

Solution 2

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

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top