tags:

views:

276

answers:

3

Hi guys,

I am building a german payment provider into my site.

But when I click on "Submit", nothing happens. Can someone please help me? I think I've looked at it too much and I can't see the forest for the trees anymore...

        <form method="post"  action="https://www.sofortueberweisung.de/payment/start"&gt;
            <input name="currency_id" type="hidden" value="EUR" />
            <input name="reason_1" type="hidden" value="Zambuu" />
            <input name="user_id" type="hidden" value="29593" />
            <input name="project_id" type="hidden" value="80145" />
            <input type="submit" value="Absenden" />
        </form>


Okay, so it's a little bit unclear what I want, it seems:

I have a lot of asp-sites allready, and now I must send, however, the information that is given by the hidden inputs by post-method to the site "sofortüberweisung.de/payment/start".

However I can solve it, it's not nessecary, there is no need for a form-tag, if there is another solution (e.g. with the code behind).

So: How can I send a lot of post information (these here is only an exmaple, in the real site there are a lot more) with code and redirect it to the right site?

+2  A: 

Your button needs to have the runat="server" attribute set and it might be worth doing the same on your form atttribute.

Also remember in asp.net webforms you can only have one form tag.

David
I know that with the 1 form tag, but how should I handle it? These - and nothing else - is the given code!
Kovu
Have you worked with code behind? there should be an aspx.cs file with that page, you can press f7 on that page to bring up the code behind. in that code behind you need a handler like:protected void button_clicked(object sender, EventArgs e) {// code to do something}then in your aspx page replace the <input tag> with an asp button liek this:<asp:button id="mybutton" runat="server" onclick="button_click" text="submit" / >
David
then whenever that button is clicked, u can handle it int he code behind and do something..
David
I think he's using a plain html form on an asp page to post data to a 3rd party payment provider, in which case the codebehind shouldn't affect whether his form works. Although it's true he could send the data to codebehind on his page and then have that do the postingIf you're not using the codebehind, is it really necesary to have the page as an asp.net page rather than a plain html page
zeocrash
Please see edit
Kovu
A: 

I've had this issue a couple of times before where when creating an HTML form inside an ASP.NET form tag, the inner form just wouldn't post out.

One solution for me was to adjust the ASP.NET form tag wrapper for that page (moving the close above the HTML tag).

Another (where I needed ASP.NET controls obove and below the HTML form) was to add an iframe, passing the parameters for the form post to the iframe URL. Using JavaScript, the iframe then used those parameters to post the form to a new window/the parent window. Probably better ways, but it worked for me.

Chris
+1  A: 

If the code you have provided is within a standard ASP.NET form, so that you have nested form tags, try the solutions provided to this Stack Overflow question.

If it is possible to have this page be a simple html form, that is another possible solution.

Jason Berkan