Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 628249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:36:57+00:00 2026-05-13T19:36:57+00:00

I have an asp.net page in an iframe where all links target _blank <base

  • 0

I have an asp.net page in an iframe where all links target _blank

<base target="_blank" />

But I want the form on it to submit to _self (i.e. the iframe where the page is located) when the one button is clicked. The form is an <asp:Panel> with an <asp:Button> control for submitting it.

Where can I set the target for this form? Since there isn’t a <form> tag or an <input> tag in the file (ASP.NET makes them when it renders the page), I don’t know how to change the target to override my <base> tag.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T19:36:58+00:00Added an answer on May 13, 2026 at 7:36 pm

    I just found this post on the asp.net forums by mokeefe that changes the target by javascript.

    I just put it in my page and tried it. I had to make these modifications:

    1. I’m using asp tags only, so I have <asp:Button> not <input type="button"> and my onclick has to be the server-side method I’m calling on submission. Therefore I put this new javascript in OnClientClick:

    <asp:Button ID="cmdEmailSearch" runat="server" Text="Search"
                OnClick="cmdEmailSearch_Click"
                OnClientClick="javascript:pageSubmit()"/>
    

    2. I removed the myForm.submit() since ASP.NET renders the page putting the WebForm_DoPostBackWithOptions() javascript in the button’s onclick right after it puts my pageSubmit()

    <script type="text/javascript">
    
        function pageSubmit(){
            // where form1 is the Parent Form Id
            var myForm = document.getElementById('form1');
            myForm.target = '_self';
        }// end function
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.Net Page, aspx with its default form. I have a Submit
I have ASP.NET page with an iframe on it for displaying some pdf reports
i have asp.net page that is opened inside an iframe. How to redirect to
I have page with other asp.net page inside iframe. And on button click inside
I have asp.net page and I have an Iframe inside of the page. In
I have an asp.net website with a master-page, can I use the iframe so
I have a simple ASP.NET web form on a page, which is contained in
I have this asp.net page as below. <body> <form id=form1 runat=server> <div class=page >
I have an ASP.net aspx page that's composed of 3 iframes. One for the
I have ASP.NET page, it calls webservice via $.ajax and returns result in json

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.