Showing posts with label master. Show all posts
Showing posts with label master. 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

Monday, March 26, 2012

Modal Popup Offset in website with Master Page

Hi.

I am using the Atlas modal popup tool in my website. However, the popup covers only the ContentPlaceHolder tag area and the other parts of the Master Page, namely the header and the leftcolumn (where I have menu options) are not covered. Curiously, the alpha filter seems to be offset by the area of the header and the leftcolumn. This really has me stumped. Any help would be deeply appreciated.

I am using tables to align my controls, but removing the Panel that is displayed as the modal popup from the table and placing it below the table seems to have no affect.

Thanks!

I think you'll findthis thread helpful.
Thanks for the link. It was helpful and I was able to sort my problem. The problem was that one of the div tags that wraps around all my content had the position set to "relative". A very basic error I guess, but I am a beginner after all!! Thanks again for the reply and link.

Modal Popup not working in page inside Master Page

I followed the how-to example to create a page with modal popup and it works fine. However when put the same code in a page which is inside a master page, it seems not able to pick up the class attributes from style sheet which is located in root of the web. Is there any workarounds for this?

SLICan:

I followed the how-to example to create a page with modal popup and it works fine. However when put the same code in a page which is inside a master page, it seems not able to pick up the class attributes from style sheet which is located in root of the web. Is there any workarounds for this?

A liitle bit better now, after I made a copy of the style sheet from root to the folder where the aspx page resides, now I can see the requesting page dim-out and the pop up appears on the screen under two different scenarios:

(1) If I used default value(-1) for X, Y, left bottom portion of the pop up appears on the top right corner of the requesting page and button inside the popup is clickable.

(2) If I changed value of X, Y to something else, entire pop up appears in the center of the screen but is dim-out too. In addtion, if I specified drop shadow to true, then the shadow appears on the top right corner of the screen.

Can anyone help?


SLICan:

SLICan:

I followed the how-to example to create a page with modal popup and it works fine. However when put the same code in a page which is inside a master page, it seems not able to pick up the class attributes from style sheet which is located in root of the web. Is there any workarounds for this?

A liitle bit better now, after I made a copy of the style sheet from root to the folder where the aspx page resides, now I can see the requesting page dim-out and the pop up appears on the screen under two different scenarios:

(1) If I used default value(-1) for X, Y, left bottom portion of the pop up appears on the top right corner of the requesting page and button inside the popup is clickable.

(2) If I changed value of X, Y to something else, entire pop up appears in the center of the screen but is dim-out too. In addtion, if I specified drop shadow to true, then the shadow appears on the top right corner of the screen.

Can anyone help?

It's been discussed inhttp://www.codeplex.com/AtlasControlToolkit/WorkItem/View.aspx?WorkItemId=2939 but I don't understand exactly what need to be done. Can someone elaborate it?


I got this issue addressed. What I did was: (1) download AJAX contol toolkit with source, (2) change ModalPopupBehavior.js, (3) rebuild AJAX control toolkit and (4) reload the dll to my project.

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...

ModalPopExtender, Javascript & Master page

Hi

I googled about this problem and never found an answer. Everybody is complaining about it but nobody found any solution. I thought I will put the problem in this forum so some AJAX Guru can research and help us.

Here is the problem,

Whenever you use the ModalPopExtender and try to do something during begin of the postback or at the end of post back via javascript. It works fine in the single page. But as soon you add a master page, it doesn't work. It either says "null, null object not found" or object not found.. Whats the problem when its master page

<scripttype="text/javascript">

Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(beginRequest);

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(endRequest);

function beginRequest(sender, args){

// show the popup

alert("here0");

var cmb = $find('mdlPopup');

//alert("here");

//find$('<%= mdlPopup.ClientID %>').show();

//var cmb = document.getElementByName('<%= mdlPopup.ClientID %>');

//var cmb = document.getElementByName(GetClientId("mdlPopup"));

if (cmb !=null) {

cmb.show();

alert("here2");

}

}

function endRequest(sender, args) {

// hide the popup

alert("here3");

$find('mdlPopup').hide();

}

</script>

<asp:UpdatePanelID="updatePanel2"runat="server">

<ContentTemplate>

<table>

<tr>

<td>

Signature:</td>

<td>

<asp:TextBoxID="signatureText"runat="server"/></td>

</tr>

<tr>

<td>

Bio:</td>

<td>

<asp:TextBoxID="bioText"runat="server"/></td>

</tr>

</table>

<asp:ButtonID="Button3"runat="Server"Text="Save"/>

<asp:LinkbuttonID="Button1"runat="Server"Text="Save"/>

<br/><br/>

Hit Save to cause a postback from an update panel inside the tab panel.<br/>

</div>

</ContentTemplate>

</asp:UpdatePanel>

<ajaxToolKit:ModalPopupExtender

ID="mdlPopup"runat="server"TargetControlID="pnlPopup"

PopupControlID="pnlPopup"BackgroundCssClass="modalBackground"/>

<asp:PanelID="pnlPopup"runat="server"CssClass="updateProgress"style="display:none">

<divalign="center"style="margin-top:13px;">

<imgsrc="../Images/simple.gif"/>

<spanclass="updateProgressMessage">Loading ...</span>

</div>

</asp:Panel>

It will really help if somebody finds a solution for it..

VIJAI

Hi,

Thank you for your post!

This works on my machine:

<script type="text/javascript">
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(beginRequest);
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(endRequest);
function beginRequest(sender, args){
alert("here0");
var cmb = $find('<%=mdlPopup.ClientID %>');
cmb.show();
alert("here2");
}
function endRequest(sender, args) {
alert("here3");
$find('<%=mdlPopup.ClientID %>').hide();
}

</script>

If yo have further questions,let me know!

Best Regards,

ModalPopExtender DynamicServiceMethod with Master Page

If I place this in a <asp:content> on master page:

<asp:linkbutton runat="server" id="testLB" text="test" />
<atk:ModalPopupExtender runat="server" ID="mpuNotes" TargetControlID="testLB" PopupControlID="panmpu"
BackgroundCssClass="modalBackground" DropShadow="true" OkControlID="mpubutOk"
DynamicControlID="panNote" DynamicServiceMethod="GetNote">
</atk:ModalPopupExtender>
<asp:panel runat="server" id="panmpu" cssclass="modalPopup">
Davs
<asp:Panel runat="server" ID="panNote" />
<asp:Button runat="server" ID="mpubutOk" Text="Close" />
</asp:panel>

And the codefile looks like this:

[System.Web.Services.WebMethod]
public static string GetNote()
{
return "Hello - CodeFile";
}

The method is NOT called, but when moving it on a normal webform, it works. How to get it to work in a master page?


Looks like the ScriptService method is missing:http://blogs.msdn.com/sburke/archive/2006/10/21/hint-components-that-use-web-services-with-asp-net-ajax-v1-0-beta.aspx