Showing posts with label controls. Show all posts
Showing posts with label controls. Show all posts

Wednesday, March 28, 2012

Modal Popup creation problem

I have a project that has several asp .net AJAX controls including a Tab Panel extender, a couple of updatepanels, and a modalpopup. Everything was doing OK (except for the tab panel that keeps disappering on hover over) until I added the modal popup. The page will load but I noticed that I was getting an "Done, but with errors on page" warning and the calendar that sets everything in motion didn't work.

It appears that the modalpopup isn't being created properly at runtime. I see this error message when I follow the error message in Firefox (Firebug):

this._popupElement has no properties
http://mycomputer/mysite/ScriptResource.axd?d=SpCqOYElt5QoLvf_3bBsv_BcFBS3DknA98So9KH3qtFJpwGddMmhi5Fqd8Ekf5Yggy7J5Sw9EaHCqlfKI150bSF4O1S83qGJROU-7k6SGQc1&t=633121015687656250
Line 66

Which further expands to:

initialize()ScriptResource.ax... (line 66)

Sys$Component$endUpdate()ScriptResource.ax... (line 2702)

Sys$Component$create(function(),Object BackgroundCssClass=modal CancelControlID=btnClose,null,null,input#Trigger)ScriptResource.ax... (line 2856)

(no name)()livereports.aspx (line 217)

_handler(Object _disposableObjects=[4] _components=Object,Object)ScriptResource.ax... (line 2503)

Sys$_Application$_doInitialize()ScriptResource.ax... (line 3792)

(no name)()

Why isn't there a comma between Object BackgroundCssClass=modal & CancelControlID=btnClose? Where are all of the properties that I set? This is how the modalpopupextender is set up in my project:

I am totally lost since I don't see much difference in the source code between mine and the AJAX samples function:

Mine:

Sys.Application.add_init(function() {

217 $create(AjaxControlToolkit.ModalPopupBehavior, {"BackgroundCssClass":"modal","CancelControlID":"btnClose","DropShadow":true,"DynamicServicePath":"/scmghd/livereports.aspx","OkControlID":"btnClose","PopupControlID":"gvResults","PopupDragHandleControlID":"pnl1","id":"ModalPopupExtender2"}, null, null, $get("HiddenModalTrigger"));

218});

AJAX Sample:

Sys.Application.add_init(function() {

314 $create(AjaxControlToolkit.ModalPopupBehavior, {"BackgroundCssClass":"modalBackground","CancelControlID":"ctl00_SampleContent_CancelButton","DropShadow":true,"OkControlID":"ctl00_SampleContent_OkButton","OnOkScript":"onOk()","PopupControlID":"ctl00_SampleContent_Panel1","PopupDragHandleControlID":"ctl00_SampleContent_Panel3","dynamicServicePath":"/AJAX/AjaxControlToolkit/Samples/ModalPopup/ModalPopup.aspx","id":"ctl00_SampleContent_ModalPopupExtender"}, null, null, $get("ctl00_SampleContent_LinkButton1"));

315});

This is the way I have the modalpopup set in Visual Web Dev:

<cc1:ModalPopupExtenderID="ModalPopupExtender2"runat="server"BackgroundCssClass="modal"TargetControlID="Trigger"PopupDragHandleControlID="pnl1"PopupControlID="gvResults"CancelControlID="btnClose"OkControlID="btnClose"DropShadow=true>

</cc1:ModalPopupExtender>

Again any help is appreciated!

I hate to be a bother but this project is very important...any help would greatly be appreciated.

Thanks

Modal PopUp Extender

Based on the video example about using modal Popupextender. But the only changes i did is replace the option controls to textbox controls. The flow will only display the text on what I've inputted on the textbox in the modal window. The problem is how am I going to refresh the value of the textbox to null everytime I clicked the button to popup the modalwindow?

This might help:http://forums.asp.net/t/1137922.aspx

Modal Popup events not responding

I have a modal popup control that is created dynamically along with various other controls on Page_Init. Actually it's a user control created dynamically, and part of that user control is the modal popup.

Inside the modal popup is basically just a grid view with some hyperlink columns. The problem is that none of the links ever seem to respond. The popup is shown by a serverside call to the Show() method.

I experimented and put a few buttons and various other controls, and while the button animates like it's been pressed, no server code fires. This happens reguardless of the control type; radiobuttons won't even check. This occurs in controls both inside and outside of the gridview.

Anyone run into something similar with a dynamically created modal popup?

When the controls are being created dynamically, are you attaching events to the objects that will be posting back (ie the modal popup window). I have a similar situation where I have a user control that dynamically creates buttons. The buttons did not work until I added a event handler once I created them. When you add conntrols to a page, this is done automatically, but If you create a control dynamically, you must tell the page what to do with its events when they are raised. Make sence?

-Alan


Yes, it makes sense. The standard events that are tied into the controls, Page_Load, Page_PreRender, etc. all fire fine at the right times. It's only UI events like Click that don't respond on the server side. I can get them to execute javascript (of course) but I'd like to avoid having to hack together a callback function just to get a button working. Besides wiring the buttons/links/etc with events directly from the aspx page, I've tried adding the controls dynamically also (within the dynamically created user control housing the modalpopup) and then wiring them to the events.

Adding the controls that way in the user control's Load, and Init events both yield the same results. The code gets run and the controls get created, but they do not respond to UI events.

Monday, March 26, 2012

modal popup extender help

Hi I am having a problem with Modal Popup Extender control. I have two web user controls, sign in control and register control(I am not using the default controls provided by asp.net). On my start page if the user clicks on "Sign In" i want to show the sign in control in a popup. If the user clicks on "Register" i want to show the register control in a popup.

Now if i only have 1 modal popup extender(for sign in control), everything works fine as expected. But as soon as i add one more modal popup extender(for register control), both controls stop working.

Has anyone encountered a similar problem? Am i missing something?

Any help or tips will be great. Thank you for your time. -Sanjay.Maybe check for script errors during page load?

Modal popup extender shows before page is done rendering ?

Hi

My page consists of a single linkbutton triggering the modal popup extender and a panel containing the popups controls. This is all working except one tiny thing, on each submit postback it quickly shows->hides the popup. How can I get rid of this problem?

"mpeProjects" runat="server"
TargetControlID="lbnProjects"
PopupControlID="pnlProjects"
DropShadow="false"
OkControlID="btnProjectsOK"
CancelControlID="btnProjectsCancel"
BackgroundCssClass="DialogPopupBackGround"
OnOkScript="onOK()"
>

 

Hi,

Please make sure you have the style attribute of the pnlProjects panel set to "display:none".

If you already have some value in the style attribute, just add the above at the end of the attribute value.

Kind regards,

sbogus.

Modal Popup not posting TextBox fields

I have a strange situation in which I am using a Model Popup Control with an embedded GridView containg TextBox controls in a column. I can DataBind the GridView in the codebehind and the TextBox controls are properly populated. However, when the pack posts back, the TextBox Controls always have an empty string for the Text property? This also occurs if I replace the GridView with a Repeater or any other list control.

Other controls, like labels, have there Text property available.

craig

You might want to look at this post:

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

Look at the second page, at the last post with the JavaScript.

They have done some nice work with the modal regarding this issue I think.

There was also a workaround using the SubmitButtonBehavor = false;

Dont know if this will help you, but I thought I would give it a shot

Good luck

-Shane

Modal popup rendered inside two server controls doesnt work

I'm using the Modal popup from inside a server control named A. When I use the server control from a Page it works perfectly. But when I insert the server control A inside another server control named B, all Modal popup elements are render in page starting absolute position 0,0 where the control A is positioned inside B. I don't find a way to solve this. Any idea?

I will really appreciate any help. Thanks,

JoanBGood.

Please post the code

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

Wednesday, March 21, 2012

Modalpopup

I am trying to use the ModalPopup control on a page that has a couple of update panels. However, all controls are still enabled ( with the exception of dropdownlists which dissappear).

This is causing a huge problem, because if the button that triggers the popup is click more than once, when you close the popup using the OK/Cancel buttons, the dropdown lists do not come back as the control thinks there are other insatnces hanging around but are not visible on the screen.

Any ideas.

Thanks

Sorry. My Fault. Had not given the background attribute a css class.

ModalPopup - Multiple Controls open 1 popup?

Is it possible to have multiple controls open up the same modal popup window? I have content with 3 different links I need to openup the same modalpop up window.

Yes, that's achievable.

You can add client side click event handler to those links, and show the modalpopup in the handler.

For instance:

<%@. Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
<script runat="server"
</script
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager
</div>
<asp:Button ID="Button1" runat="server" Text="Button" />
<asp:Button ID="Button2" runat="server" Text="Button"OnClientClick="$find('mpe').show(); return false;" />
<asp:Button ID="Button3" runat="server" Text="Button"OnClientClick="$find('mpe').show();return false;"/
<asp:Panel ID="Panel2" runat="server" Style="cursor: move;background-color:#DDDDDD;border:solid 1px Gray;color:Black">
<div>
<p>Choose the paragraph style you would like:</p>
</div>
</asp:Panel>

<ajaxToolkit:ModalPopupExtenderBehaviorID="mpe"ID="ModalPopupExtender1" PopupControlID="Panel2" runat="server" TargetControlID="Button1" >
</ajaxToolkit:ModalPopupExtender>
</form>
</body>
</html>

ModalPopup & Screen Flicker

Just as with the other controls, when the page first loads you briefly see the controls before they are hidden. However, with the modal if you set the control's visibility to hidden, it will not display when it's poped up.

Is this a known bug? or someting else?

This behavior happens to me too...
My popup panel is declared as follow, the same as the sample included in the toolkit:

<asp:Panel ID="MoveItemDialogPanel" runat="server" CssClass="modalPopup" style="display:none;" >
...

Urhh ... it's not a bug in Atlas or the toolkit ... it's a problem with the style sheets / CSS that you used. Most, if not all, of the samples work properly as shipped. Hundreds of different posts in the forum over this particular issue.

I've run into the same problem with Collapsible, Hover and ModalPopup. What you have to be really careful of ... is ensuring that if you do copy & paste (which I did) that you ensure that you've got all of the CSS in place as well.

What Atlas (and other Ajax frameworks) are doing is taking advantage of the evolution of browsers and CSS. You get the "fast" response and neat effects in the browser(s) because the markup is already their in the DOM ... it's simply not visible and/or had its behaviors (event sinks) hooked up until necessary. This coupled with "smarter" postbacks (i.e don't post back every possible input field on the page, hidden viewstate, etc) ... result in less over-the-wire data movement ... less processing at the server and an overall "snappier" user experience.

All of this has been doable for years ... it's just really hard to hand-write all that markup and javascript ... and get all the edge cases correct.

ModalPopup and auto-updating controls/server-side function calls

I'm having trouble searching for an answer for this and have been unable to find one, but this seems like a very trivial question, maybe I'm just too tired to be doing this right now.

I have a ModalPopup, and in it I have 5 textboxes(all with autopostback enabled) and two dropdownlists, also with autopostbacks. Now, what I want to have happen is when I change the dropdownlists, the values in the textboxes inside the ModalPopup will change, but I don't want the popup to close. Right now, the autopostbacks are working as they should, but the popup closes each time.

This is my ModalPopupExtender code:

<cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server"> <cc1:ModalPopupProperties TargetControlID="LinkButton1" PopupControlID="PanelEdit" BackgroundCssClass="modalBackground" DropShadow="true" CancelControlID="NoButton" OnCancelScript="onNo()"> </cc1:ModalPopupProperties> </cc1:ModalPopupExtender>

Now, one thing I thought of was the fact that there's no OkControlId defined, this is sort of a hack to get my Ok button to actually call the server side code for the Ok button, rather than just the javascript. If this is the problem, how do I define the OkControlId, and have it call the server-side code associated with the button?

I appreciate any help anyone can offer to my problem, and if you need any more code, let me know.

Hi,

I don't know the details of the ModalPopup, but did you try to wrap the ModalPopup content (5 textboxes + ddls) inside an UpdatePanel? Performing a partial postback should keep the popup visible (just guessing though).


I originally wrapped the panel containing my controls in an UpdatePanel, but that didn't work. I just now tried putting the actual ModalPopupExtender into the same UpdatePanel, but it had no effect, the popup still disappears when the autopostback is triggered.

Hi,

I mean, not wrapping the extended Panel, but the content of the ModalPopup (inside the Panel). Did you try that?


I just tried that, but to no avail. As far as I can tell, the behavior hasn't changed at all when I put the UpdatePanel around just the controls inside the panel.

This won't solve the issue

I had the same problem but in vain. Any postback from any element in the ModalPopup will close it


Did you find a workaround for it? Like, is there a way to disable postbacks from cosing the ModalPopup, then just do it inside the button that you want to close it?
This post suggests an easy way to re-display the ModalPopup on the server during the postback with the 60914 release.

After looking at the post, I see the new way to do it, but I am having a problem:

I'm running the following code in the page load event...

ModalPopupProperties popup = ModalPopupExtender1.GetTargetProperties(UpdatePanelEdit);
if (popup !=null)
popup.Show();// Or call popup.Hide();

My problem is, popup never gets assigned to anything except null...does this code have to be placed somewhere outside of the Page_Load?


The control passed to GetTargetProperties needs to be the one that's specified as the TargetControlID for the ModalPopupProperties.
Ok, I changed the control names and whatnot, and now the properties isn't null, but the .Show() doesn't actually do anything. I've stepped through the code, and it does execute the popup.Show(); but it doesn't have any effect. I removed the UpdatePanel I had, and just used a regular Panel control to contain the popup. The above code is in the Page_Load, does it need to occur before the actual page load?

I had a problem somewhat similar to this.

What happens on postback, is it rebinds the display:none style to the panel, hiding it.
In mine, I had a gridview and several buttons that would change the contents of. I ended up wrapping just the gridview in an update panel, and assigning each of the buttons to a trigger for the update.

Not sure if you can use this in your situation but I hope it helps.

ModalPopup + UpdatePanel + UpdateProgress

I have an operation that takes about 1min to complete. I like the updatepanel and updateprogress controls but I would like to incorporate these with a modalpop. I would like the popup to contain the updateprogress control. I tried to implement this but it does not work. Has anyone tried to do something like this?I still have the same Problem. I want to user a ModalPopup in combination with UpdateProgressTemplate. Is there any possibility to goin' like that?

@. MVPs and all Gurus: HELP PLS ;p

greets from Germany @. 38°C ;p
I have the same question, you can check it herehttp://forums.asp.net/thread/1406095.aspx