Showing posts with label targetcontrolid. Show all posts
Showing posts with label targetcontrolid. Show all posts

Monday, March 26, 2012

Modal Popup Extender with multiple TargetControlID?

Hello, I'm new to the toolkit and I'm looking for ideas to accomplish a somewhat trivial goal.

What I want is to show a panel in modal form base on the item chosen on a list.

Imagine a list of employees and you want that when the user clicks on one of them a modal window comes up and allows the user to edit the chosen employee's data.

the problem is that the ModalPopupExtender has room just for a single TargetControlID.

Does anyone know a way to accomplish this?


TIA

Yes I beleive you are correct in that the ModalPopupExtender allows only one TargetControlID, however you can have multiple ModalPopupExtenders on a page if you need multiple (different) Panels for input.

If you need only one Modal and want to show it from many different events you can create a button which will be shown as visible inline but on Page Load set the visibility to none and set it as your TargetControlID. Then in any events you need the modal simply call ModalPopupExtender.show() method with 'ModalPopupExtender' being the ID of your extender. The reason I say to leave the visibility set to true inline is I recently read a post where the Events were not getting attached at run time in some cases unless they were set to visible at compile time. If you take a look at the Sample code for the toolkit they have an example of this scenario. Also keep in mind you might want to call the hide() method on the ModalPopupExtender when your finished with Input as some never get disposed and might cause problems next time you try to show one.

Hope this helps...

Modal PopUp problem

Hi guys, my name is steven.i have a problem with modalpopupextender.

i have a linkbutton as the targetcontrolid.

the modalpopupextender runs perfectly as i click the linkbutton, but the code inside linkbutton_click was not executed.

my question is how can i execute the code inside linkbutton_click?

thanx for the sharing.

That is because the ModalPopup prevents the default event so no other handlers will be called. If you would like code to execute before or after the modalpopup window is shown you can hook into the 'showing' or 'shown' events. Here is alink to a postthat shows how to do that.

_onShow :function(e) {

/// <summary>

/// Handler for the target's click event/// </summary>/// <param name="e" type="Sys.UI.DomEvent">/// Event info/// </param>if (!this.get_element().disabled) {this.show();

e.preventDefault();

returnfalse;

}

},


mmm i kinda confuse...

here what i want to do, i have a linkbutton as the targetcontrolid from modalpopupextender.

the popupcontrolid is panel1. inside panel1 there is a detailsview in readonly mode.

when i click the linkbutton i want the popup show and the detailsview is in insert mode.

can you tell me how?

thanx so much.

Saturday, March 24, 2012

Modal popup TargetControlID set to a control from within a DataGrid?

Can someone please tell me how to set the ModalPopupExtender TargetControlID property to an ImageButton control that is part of a template column of a DataGrid? The designer doesn't allow me to set it to the required control, and when I set it in the .aspx source I get a run-time error.

Thanks...

Hi,

Would you please post some code,so I can reproduce the problem and resolve it more quickly?

Thanks


A bit too much code to post. I have an ImageButton inside an DataGrid template column. The DataGrid is in a table. Outside the table I have a Panel and ModalPopupExtender, but I can't set it's TargetControlID to the ImageButton. I can set it to other ImageButtons in the table.