Click here to Skip to main content
14,698,142 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to open form inside another form on click on a button add new to insert record, but my form is in master page.. any help in this please ..
in the below code i write a script to open it in new tab , but i need to open inside the page..

What I have tried:

<%@ Page Title="" Language="C#" MasterPageFile="~/AquaBaby.master" AutoEventWireup="true" CodeFile="Menu.aspx.cs" Inherits="Menu" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Title" Runat="Server">
     
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="head" Runat="Server"> 
    <link href="css/bootstrap.min.css" rel="stylesheet" />
    <link href="css/Style.css" rel="stylesheet" />
    <script src="Jquery/jquery-3.3.1.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
     <script type = "text/javascript">

         function SetTarget() {

             document.forms[0].target = "_blank";

         }

</script>
 
    
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="Body" Runat="Server" EnableViewState="True" > 
      
    
    <asp:Label ID="Label1" runat="server" Text="Search:" Font-Bold="True" Font-Size="Medium"></asp:Label>

    <asp:TextBox ID="Searchtxt" runat="server" Height="24px" Width="182px" CssClass="textbox1"></asp:TextBox>
      
     <asp:Button ID="Button1" runat="server" Text="Search" CssClass="btn1" Font-Bold="True" Height="27px" Width="131px"  OnClick="Button1_Click" OnClientClick = "SetTarget();" />
Posted
Updated 23-Apr-20 6:48am

1 solution

Try use a modal form and use this to avoid accidentally closing the form
<div class="modal fade" data-backdrop="static">
    ...
</div>
   
Comments
Rajaa Khalifeh 23-Apr-20 11:58am
   
when i put it under content body all the data is hidden i just need on click on button to run the form inside this form
Fernando_Costa 23-Apr-20 12:22pm
   
HTML doesn't allow a form to be inside another form. why you dont hide some informations on your form and show when you click a button?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900