skip to Main Content

I have one page with masterpage as ‘checkout.aspx’ with asp button in bottom

<%@ Page Title="" Language="C#" MasterPageFile="~/allpage.Master" AutoEventWireup="true" CodeBehind="checkout.aspx.cs" Inherits="CafeSite.checkout" %>
<asp:Content ID="Content1" ContentPlaceHolderID="title" runat="server">
B Cafe Checkout
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="body" runat="server">
    <br>
<form id="form1" runat="server" action="submit.aspx">
        <div style="text-align:center;">

        <p style="color:orangered;font-family:'B Koodak';">
            <span style="color:white;">آقا/خانم:</span>
            <input type="hidden" name="last-form-name" value="<% =Page.Request.Params["last-form-name"] %>" /> <% =Page.Request.Params["last-form-name"] %>
        </p>
        <p style="color:orangered;font-family:'B Koodak';">
            <span style="color:white;">به شماره موبایل:</span>
            <input type="hidden" name="last-form-phone" value="<% =Page.Request.Params["last-form-phone"] %>" /> <% =Page.Request.Params["last-form-phone"] %>
            &emsp;
            <span style="color:white;">به شماره میز:</span>
            <input type="hidden" name="last-form-sellist" value="<% =Page.Request.Params["last-form-sellist"] %>" /> <% =Page.Request.Params["last-form-sellist"] %>
        </p>
        <input type="hidden" name="order" value="<% =Page.Request.Params["order"] %>" />
        <input type="hidden" name="count" value="<% =Page.Request.Params["count"] %>" />

</div>

<p id="P-Header">
    سفارشات شما
    به شرح ذیل می باشد
</p>
    <div class="text-center">
        <div class="text-center">
            <div id="Table-Div" class="container" >
                <asp:Table ID="Table1" runat="server" Height="100%" Width="100%">
                </asp:Table>
            </div>
        </div>

        <br>

    <asp:Button ID="Button1" runat="server" form="form1" CssClass="btn-success rounded" Text="مورد تایید است" PostBackUrl="~/submit.aspx" />
    </div>
</form>

<br>
</asp:Content>

my asp button has postbackurl to my submit page but is not working
I don’t know how to solve this proble. does anyone know how to solve this and help me?

2

Answers


  1. Chosen as BEST ANSWER

    I found the answer of my question. In the aspx page with master page the form id is change and so here we should edit form properties on asp button from form1 to aspnetForm.

    <asp:Button ID="Button1" runat="server" form="aspnetForm" CssClass="btn-success rounded" Text="مورد تایید است" PostBackUrl="~/submit.aspx" /> 
    

  2. Add the form to the master page not the subpage just after the body.

    Something like

    <body>
    <form runat="server" id="myformID" enctype="multipart/form-data">
    

    Then just add a button to the sub-page and wire it up like normal in the code behind

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search