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"] %>
 
<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
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.
Add the form to the master page not the subpage just after the body.
Something like
Then just add a button to the sub-page and wire it up like normal in the code behind