Showing posts with label pages. Show all posts
Showing posts with label pages. Show all posts

Wednesday, March 28, 2012

Modal Popup causing double page load

I'm having a problem where it seems that the Modal Popup is causing my pages to double load. I have a simple Master page file which just has my modal popup on it and my pages create the event handlers for the images on the modal popup. When i put a break point on page load i can clearly see that my pages are loading two times.

I'm wondering if anyone else has had this problem and if so is there a simple solution?

Thanks,
Kam

I seem to have answered my own question. I had ImageButtons inside the target panel and those were causing the page to load twice. when i set the visible to false so that they don't render on the page the page doesn't double load.

This might be a bug. Can someone else test it and see if you get the same results?

Thanks,
Kam


I also have a similar problem. I didnt understand all of your answer.

I have a modal popup with an updatepanel with 2 DDL's, 2 image buttons

and 2 text boxes..the DDL's and text boxes have theirautopostback=false

and the DDL's also havecausesvalidation=true.When I click either button,

the code behind fires twice..?? Happy to post the markup if you want..when

do you set thevisible=trueon your buttons? How does that cause a double load?

Thanks..


This can occur if the page is the default page for the application (e.g. default.aspx) and an image or imagebutton is missing the imageurl attribute.

Ok..no help for me..I'm not on the default page, and

my urls are specified..any idea why the code behind

for the 2 imagebuttons fires twice for each click?

Thanks..


Could also be due to a double up with autoeventwireup and manual wiring up of the events:http://forums.asp.net/thread/1287221.aspx

Jason:

I left a detailed response for you at the same link.

Spent the entire weekend trying to get it going by all

combinations of true & false for both the page and the control..Tongue Tied

no luck..Crying

http://forums.asp.net/thread/1287221.aspx

Thanks for your input..Cool

Saturday, March 24, 2012

Modal Popups with Master pages?

Is there some trick when using a modal popup within a control of a masterpage? Where is one suppose to put the script manager, in the master page or in each individual page... I don't know what I'm doing wrong but it's not working right now. The panels that I want to be popups are just appearing on the page embedded like normal and when I click the button that would normally activate them the page just does a complete refresh and nothing else happens. Thanks in advance!

I'm pretty sure it's because of the evil "sys is undefined" error message. Well it's good to know that it's not something I'm doing =).


Wait a minute, why does AJAX work fine on other applications I have made in other instances of VS 2005, but with this particular web application it says "sys is undefined" ?


Found this post on google and it fixed it. Added the following line to web.config within the httphandlers tag:

<add verb="GET" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler" validate="false"/>

The original post:http://forums.asp.net/t/1055400.aspx Thanks Jasson King who posted that about 7 months ago! =)


What is going on... I added that line in web.config and it worked fine for about 2-3 hours and then for one reason or another I had to restart the application and now it's back to the same old business of "unknown element, could be a compilation error"...

What else is there to do?


Made another find.

<%@.RegisterAssembly="AjaxControlToolkit"Namespace="AjaxControlToolkit"TagPrefix="cc1" %>

I'm using master pages and I have this line of code in one of the pages that is displayed in the content holder, but I also found it in the master page file. I commented it out of the master page code and now it all works fine again...