ASP. NET Ajax Control Toolkit: modalpopupextender usage tips)
1. You can use
- Client (JavaScript): $ find ('[modelpopup. clientid]'). Hide ();/show ();
- Code behind: [modelpopup]. Hide ()/. Show ();
2. if you want to use more than one show/hide button, you can use the (1) method to convert the onclientclick parameter JavaScript of the button. You can also use the common control (such as textbox) use [textbox]. attributes. add ("onclick", "$ find ('" + [modelpopup. clientid] + "'). show ();") 3. If you want to disable pop-up after pop-up quit and press "ESC" quit, you can skip this test.HereAndHere. However, if there is more than one modalpopup in the same region, or if I change modalpopup to webcontrol as I do, this method will be useless. My current solution is:
- Add [panel] to the Panel for pop-up. attributes. add ("onkeydown", "If (event. keycode = sys. UI. key. ESC) {$ find ('"+ [modelpopup. clientid] + "'). hide (); Return false ;}");
- Add $ get ('"+ [any control in panel] +"'). Focus () on any control that triggers modelpopup show ();
|