Close modalpopup inside another modalpopup - asp.net

I have a problem a few days ago that I cannot solve:
I have a modals popups extender from asp.net that when pressed on a button opens another popup (if something changes, both are users controls only).
The problem arises at the close of the second. I am currently using:
modalpopup.Dispose ()
When you do this, the modal pop up leaves, causing the first to stop responding.
If you need, I can attach some part of the code that can guide you. Thank you!

Related

How to close Popup dialog in code behind?

Popup dialog
My purpose of closing this popup dialog is when some filters in my page was changed this popup dialog is no longer relevant so I wanted to close it under my List item SelectedIndexChanged event but I could find any solution yet. Although user can just click the close button but It would be better if it can be done in code.
Glad if you can help. Thanks

ASP.NET - Tab order not working after ajax postback - Goes to the browser url

I have used Update Panels in my ASP.net webpage. I have a modal popup. But the tab index is set to -1 for all the parent page controls once the modal popup comes in picture.
Does anybody has resolution for this. I tried again reseting the tab index through javascript......But its not working(may be DOM is not getting refreshed)
Regards,
Justin Samuel
I have seen this happen when you have multiple ModalPopupExtender controls open at the same time. If you hide whichever popups you aren't currently using, that fixes the problem. (Or at least it did in my case.)

How can I display a free floating panel for an input form using PopupControlExtender?

I'm currently playing around with the PopupControlExtender in the ajaxToolkit and can't quite get the functionality I want.
I'm trying to display a free floating "help" panel for an input form.
Once the user presses the help button on the form the panel pops up and displays no problem however once I click back on the main form it dissappears again.
I understand this good behaviour for most applications but I'd like to get the popped up panel to stay on screen until explictly closed (via a close button within the panel itself).
Is this possible and if so how?
Might give the ModalPopupExtender a try. It locks the main page out until an event takes place on the popup.

ASP.net ACTK DragPanel Extender on PopupControlExtender with UpdatePanel does not drag after partial postback

I have a panel on an aspx page which contains an UpdatePanel.
This panel is wrapped with both a PopUpControl Extender as well as a DragPanel Extender.
Upon initial show everything works fine, the panel pops up and closes as expected and can be dragged around as well.
There is a linkbutton within the UpdatePanel which triggers a partial postback. I originally wanted to use an imagebutton but had a lot of trouble with that so ended up using the linkbutton which works.
Once the partial postback is complete I can no longer drag the panel around.
I would love to hear suggestions on how to fix this.
Has anyone else encountered this problem?
What did you do about it?
Do you know of any other way to accomplish this combination of features without employing other third party libraries?
Take a look at when the drag panel extender and popup control extender actually extend your panel.
Chances are those extenders work on an initialization event of the page. When the update panel fires and updates your page the original DOM element that was extended was replaced by the result of the update panel. Which means that you now have a control that is no longer extended.
I don't really know of an easy solution to this problem. What will probably work is if you can hook into an event after the update panel has updated the page and extend the panel again.

Why does a button control need to be clicked twice?

I've got a web application working using VB and Ajax. I'm using updatepanels to avoid the irritating "flicker" on postbacks to the server.
I would like to have a button control defined within the updatepanel itself (tried moving it outside and got some catastrophic error, so left it there) that makes the current panel not visible and a sibling panel visible. This works with the exception that the button must be clicked twice. Not double clicked, but clicked once than clicked again.
In setting breakpoints I discovered the code behind that's attached to the button is actually being executed on the first click, but the panels don't switch as expected. If I click the same button OR worse yet, a different button, the expected behavior of the second panel appearing occurs. However, with the second button being clicked there's an unwanted bonus of a third panel being displayed, the third panel being made visible due to the second button being clicked.
I'm assuming this behavior is due to the updatepanel and its Ajax nature. Is there a way to avoid the second click? Am I misusing the updatepanel? I really wanted to use a modal popup (right out of the AjaxToolKit) but had problems with posting back the data so I opted for this approach. Any insights, assistance, even criticism would be welcome as this has plagued me long enough. Thanks
If you get rid of the UpdatePanels do things work as expected with PostBacks? Chances are something in your Page_Load or other event higher up the chain are "resetting" things in some way before it gets to your click event. Could this be the case?
I think your problem is that only the update panel is receiving data from the server after the method executes. The panel your are trying to change is outside of the update panel so it does not know that its properties have changed.
You either need to do a full page postback or have the panel you wish to modify inside the update panel.
I have run into this before and resolved it, I just can't remember how. I will try to find my old code and get back to you. one thought, do you have EnablePartialRendering enabled in your scriptmanager? maybe try wrapping both containers in a third panel.
Your update panel is sitting inside the other panels.
Should that be the other way around? AFAIK only controls within the update panel will get updated in via the AJAX call.
Here's a fairly simple solution. (I was having the same problem this morning.)
The UpdatePanel can't render stuff outside itself. So, as you noticed, the updates are happening, but you're not seeing the result.
The easiest solution is to force a full postback. You can do that like this:
protected override void OnInit(EventArgs e)
{
var scriptManager = ScriptManager.GetCurrent(this);
// or this.Page in a UserControl, etc.
scriptManager.RegisterPostBackControl(someButton);
scriptManager.RegisterPostBackControl(someOtherButton);
// etc. for each control that needs to update something outside the UpdatePanel
}
This still allows the buttons themselves to be updated in the UpdatePanel by Ajax (e.g. changing their state to disabled or enabled). The full postback only happens if the buttons are clicked.
Like others have said an update panel only updates its contents, thats one of the main benefits of using it.
Panel2 and pnlPrvCmt need to be inside your update panel for your button click method to work. Another option would be to put Panel2 inside one update panel and pnlPrvCmt inside a second update panel. Then any control inside either update panel will cause both to refresh, as long as the UpdateMode=Always (which it is by default).
Try giving the dynamic control an ID when it is created. For some reason this is required by .net for a dynamic control to work in this context.
myControl.id="newID"
I have found this to occur under 2 different scenerios:
No ID set on the control. Either the ID is left off of the markup or the the ID was not set when a dynamic control was created. ASP.Net uses the ID to track actions.
Nested UpdatePanels. Scenerio: When using a Masterpage, you might have a content placeholder that you wrap in an UpdatePanel so that an UpdatePanel is not needed in the content on the page. Then, in developing your page you might, as a habit, add an UpdatePanel.

Resources