Popup ASPX page wont stay modal up front

Hello all.  I have a popup ASPX page that is called from a click even in my code behind button.  Problem is the main parent page is posting back and for some reason it keeps staying in front and my popup page is minimizing on the bottom.  Any idea what I can do?
sbornstein2Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Raju SrivatsavayeSoftware EngineerCommented:
did you use window.focus in your script
0
brdrokCommented:
Do you SmartNavigation enabled?  If so, you'll need to turn it off or set it to false;
0
sbornstein2Author Commented:
brdrok where do I turn that off I will try that?  sriv I placed that into an onblur in the body and it did not work.
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

sbornstein2Author Commented:
I dont know if I want to mess with smartnavigation if it is by site because I am working as another developer on a project that already exists and dont want to mess with it too much.  It seems there is other popup pages that work fine and I looked through everything and mine is the same so it seems like the parent page I call it from might be in question.
0
brdrokCommented:
When you look at the HTML part of your web pages, at the top you should see something like the following:

<%@ Page language="c#" Codebehind="AddUser.aspx.cs" AutoEventWireup="false" SmartNavigation=true Inherits="SomeNameSpace.admin.AddUser" %>

"I dont know if I want to mess with smartnavigation if it is by site... " 

It is not by site, it is by page.  Every HTML page should have this page declaration that you see above.  Not sure about placing it inside the "onblur" event of the body tag...I have a pop up calendar that I call like so:

btnCalendar.Attributes["onclick"]=@"javascript:calendar_window=window.open('Calendar.aspx?formname=Form1.txtDate', 'calendar_window', 'width=200, height=200'); calendar_window.focus(); calendar_window.moveTo(420, 285); calendar_window.focus();";

Just irgnore the queryString (?formanme=Form1.txtDate) part.  
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sbornstein2Author Commented:
Ok guys I found out the problem and maybe you can help me here.  I actually have this fixed but I am trying to also do one thing.  I found that in the parent page there is a setfocus to the first textbox control that was causing this.  It looks like this.

PARENT PAGE:
at top of page

<script>
      var setFocus =true;
</script>

bottom of page
<script>
      if (setFocus) {
      document.getElementById("login_user").focus();
      }
</script>

so this was causing it.  I set it to false and it worked great.  So now I am trying to figure out is there a way to set the setFocus variable to false in the code behind easily?  I have worked around it by placing a set focus same way in the popup to my first control but I would rather leave that and still somehow set that setFocus in the parent to false.  Thanks again guys.

0
sbornstein2Author Commented:
RegisterClientScriptBlock("nofocus", "<script>\nsetFocus = false;\n</script>\n");
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.