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 7945031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:43:59+00:00 2026-06-04T00:43:59+00:00

i have the most peculiar behavior. I’m using ajaxcontrol toolkit to display modal popup

  • 0

i have the most peculiar behavior. I’m using ajaxcontrol toolkit to display modal popup window which has a form on it. this popup window is activated from a webpage which contains asp:linkbutton on it (with OnClientClick="aspnetForm.target ='_blank';" on it, i don’t think so but maybe this is relevant).
now, if i click the link then another tab is opened with the new page on it. when I am back to the original tab and activating this modal popup, if i click on the cancel button (which i have there) then the callback function is not even called (this callback just suppose to hide the popup window) and my current tab is redirected to the same page the asp:linkbutton was referring to.

Some code:

i have a page containing the following asp:linkbutton:

<asp:LinkButton ID="lbToBuy" runat="server" CssClass="ItemURLStyle" CausesValidation="false"
OnClientClick="aspnetForm.target ='_blank';">buy it>></asp:LinkButton>

this is a line from a user control which i dynamically add to some search result page.
The code behind is:

lbToBuy.PostBackUrl = "~/pages/PassagePage.aspx?i=" + itemInfo.ItemID.ToString();

now, I have another user control added to original page which is a search bar for items from my website:

        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:LinkButton ID="lbAdvancedSearch" runat="server" Style="color: #f6f7ff; font-family: Arial;
                    font-size: 12px; text-decoration: underline;">Search options</asp:LinkButton>
                <asp:ModalPopupExtender runat="server" ID="AdvSearchPopupModal" TargetControlID="lbAdvancedSearch"
                    PopupControlID="pnlAdvSearch" BackgroundCssClass="modalBackground" DropShadow="false"
                    RepositionMode="RepositionOnWindowScroll">
                </asp:ModalPopupExtender>
                <asp:Panel ID="pnlAdvSearch" runat="server" CssClass="modalPopup" Style="display: none;">
                    <asp:Panel runat="server" ID="Panel3" CssClass="modalHeader">
                        Advanced search
                    </asp:Panel>
                    <div id="SearchFormWrap">
                        <div id="SearchFormBox">
                            <br />
                            <table cellspacing="5">
                                <colgroup>
                                    <col width="100px;" align="left" />
                                    <col width="300px;" />
                                </colgroup>
                                <tbody>
SOME UNIMPORTANT SEARCH CRITERION HERE
                                </tbody>
                            </table>
                            <div style="width: 280px; margin: auto; padding-bottom: 15px;">
                                <br />
                                <div style="width: 210px; height: 30px; margin: auto;">
                                    <asp:Button ID="btnQuitAdvSearch" runat="server" CssClass="myButtonShape" Style="font-size: 14px;
                                        float: left; height: 25px; width: 100px;" OnClick="btnQuitAdvSearch_Click" CausesValidation="false"
                                        Text="Cancel" />
                                    <div style="width: 3px; height: 25px; float: left;">
                                    </div>
                                    <asp:Button ID="btnAdvSearch" runat="server" class="myButtonShape" Style="font-size: 14px;
                                        float: left; height: 25px; width: 100px;" OnClick="btnAdvSearch_Click" OnClientClick="return btnSearch_OnClientClick();"
                                        CausesValidation="true" Text="Search" />
                                </div>
                            </div>
                        </div>
                    </div>
                </asp:Panel>
            </ContentTemplate>
        </asp:UpdatePanel>

The codebehind:

protected void btnQuitAdvSearch_Click(object sender, EventArgs e)
{
    this.AdvSearchPopupModal.Hide();
}

Now, when I press the link in my page another tab is opened with the directed link as expected.
When I am back to original page and I press the advanced search button I get this modal popup displaying the search criteria. if I press the ‘search’ button everything goes as expected and a new search is formed, but if I press the ‘cancel’ button the page is redirected to the last link I was clicking (in the current tab, i.e., replaces the original page). I put a breakpoint at the btnQuitAdvSearch_Click function but it is never been called.

Any ideas?

  • 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-06-04T00:44:00+00:00Added an answer on June 4, 2026 at 12:44 am

    OK. now i figured things out. I was very sloppy.
    Although Drew provide me with a solution to one case this still didn’t explain the problem. The entire solution is different.
    The thing is that I used the suggestion this guy provided here and used OnClientClick="aspnetForm.target ='_blank';" but I didn’t implement the fix he suggested to add to body onload (there). now everything works fine.

    Thanks a lot Drew.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Quick one. I'm using mod rewrite and have most replacements in place: empty space
I am using ASP.NET 2.0 and its various providers. I have overridden most of
I am experimenting with using the Access Control Service in Azure. I have most
I am experimenting with a design for a Rails application which will have most
In WPF I have a screen for login which has a textbox for username
I am using xCode 4.2. I have most of the interface in the mainstoryboard.xib.
Currently I have most of my form's controls disabled at launch because you cannot
well i have most probably an extremly stupid problem but could not figure it
I have spent most of my web-development career in the Microsoft camp, but for
I have the most bizarre bug, where clicking a listbox item makes the listbox

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.