Click here to Skip to main content
15,889,416 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hello guys
I have a problem in a new project using C# and asp.net ,
Case is : there's a search page has search button and a list view which has another button with some fields , the search button working fine as long as I didn't click on the ListView's button which open a new tab with another page , after clicking on ListView's button and it's working fine but when I try to click on search button again ; search page redirected automatically to the last page opened by list view button .
Here's my code for the list view button and Search button

<asp:button class=" btn btn-danger center-block searchFont" style=" margin-top:25px;" id="Button2" runat="server" text="Personal Page" postbackurl="<%# String.Format("~/Details/ProDetails.aspx?proID={0}", Eval("PID")) %>"
onclientclick="window.document.forms[0].target='_blank'; setTimeout(function(){window.document.forms[0].target='';}, 500);">
Search button .................................

<asp:button id="SrcBtn" runat="server" text="Search"
class=" btn btn-danger btn-block searchFont " style=" font-size:15px" onclick="SrcBtn_Click">

any ideas please?

What I have tried:

I tried to change the action of the form by java script code in list view button but it wasn't successful ,the code was window.document.forms[0].action =" i tried to put # or the search page name "

I hope someone help me
Posted
Updated 17-Apr-21 8:41am
v2

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