Showing posts with label masterpage. Show all posts
Showing posts with label masterpage. Show all posts

Wednesday, March 28, 2012

Modal Popup and MasterPage

I have several modalpopups on a page that is inside of a MasterPage. The popups work fine, but in IE, the modalpopup opens inside the content area rather than over the entire page. I've searched these forums and have not come up with a solution. Does anyone have any ideas?


http://forums.asp.net/ShowPost.aspx?PostID=1357977 - and maybe vote on the work item to address this.

Modal Popup extender

I am trying to show and hide a modal popup in auser control which is called under contentpage of masterpage , as aseparate page the sample works fine but when embed this sample in usercontrol or content page or master page i get the error say this._popupis null or not an object

The following is the code
<script type="text/javascript" language="javascript">
var _popup;

function validate(){
// find the popup behavior
this._popup = $find('mdlPopup');
// show the popup
this._popup.show();
// kick-off the webservice, registering our callback
PageMethods.ValidateCreditCard($get('txtNumber').value, this.callback);
}

function callback(result){
// hide the popup
this._popup.hide();

// let the user know if their credit card was validated
if(result){
alert('congrats, your Number is valid!');
}
else{
alert('sorry, your Number is not valid!');
}
}

</script>
<script runat="server">
/// <summary>
///
/// </summary>
/// <param name="number"></param>
/// <returns></returns>
[System.Web.Services.WebMethod]
public static bool ValidateNumber(string Number)
{

bool isValid = false;
try
{

if(Number=="234")
{
isValid=true;
}

}
catch {}

return isValid;
}
</script>

Thanks

Are you using the $find command correctly? See the documentation:http://www.asp.net/ajax/documentation/live/ClientReference/Sys/ApplicationClass/SysApplicationFindComponentMethod.aspx.

It states "Use the findComponent method to get a reference to a Component object that has been registered with the application through theaddComponent method.".

Also, your problem could be that the client ID isn't 'mdlPopup' since it is a apart of a container control.

-Damien

Saturday, March 24, 2012

Modal Popup with asp.net controls on a masterpage through code behind

For some reason, if I have a masterpage, which has a modal popup control (or any toolkit item it seems) and if I have asp.net controls inside of that toolkit control like a textbox or something. If I try and access that textbox from code behind file of that masterpage it will not find it.

Anyone else had this issue?

I have commented out all my code and slowly tested my way through adding it back in and nothing works. But if I take that same exact code and put it on a regular (non-masterpage) file, it works like it's supposed to.

So what am I doing wrong on the masterpage to be able to find my controls from codebehind? Is there some sort of "extra" code I need to use to access items inside of a toolkit control for masterpages specifically?

Thanks.

Scratch that, I'm a freaking moron it seems.

I thought I was in the "page_load" sub, but I was not inside of any sub or function.

Apparently been a long day, I'm good now.

Thanks

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

Wednesday, March 21, 2012

ModalPopUp (Position in a MasterPage)

Hi all...

Well, I Have a Linkbutton in a MasterPage that calls a ModalPopUp...

My Problem is... when I click in the linkbutton my Panel (modalPopup) opens outside of the my screenTongue Tied and when I put the Panel in my Webform, it happens too...

Can Someone to help-me ?

cyaa

Hi Cyaa,

Can you show me a repro?

A stripped version is preferred.