Modal Window Problem - vb.net

I am using modal window for my VB.NET program and i am trying to open this child modal window from another window, afte i close the child modal window i am trying to refresh the parent but i am getting retry/cancel popup, i tried a lot of things to avoid but i can't get rid of this popup :-( is there any way i can avoid this popup? I would really appreciate your help
Thanks
Faisal

Did you tried to bind an OnClickClient javascript function to the button who close the modal popup to manually call a PostBack to the server ?
function fnClickOK(sender, e) {
__doPostBack(sender,e);
}
that's the function you must include in your code and you can bind the button in the code behind like that
yourButton.OnClientClick = String.Format("fnClickOK('{0}','{1}')", yourButton.UniqueID, "");
Like that, the postback should occur and because of the page reload all Modal will be hided.
Good Luck!

Related

How to handle modal/ pop-up using automation

Tried to handle the pop-up many ways, need clarity do we need to change the body. because when the pop-up is displayed the new class is adding it is as below.
https://i.stack.imgur.com/jQC2B.png
The actual Pop-up class is as below. there is no close button for this pop-up.
https://i.stack.imgur.com/e1ZWc.png
-By manual user can close the pop-up when user click any where in the page. When i tried click any where using automation it is displaying as element not found
Here is the code i user to handle the pop-up i am so confused how to handle the pop-up
https://i.stack.imgur.com/ibf0j.png
Thanks for help in advance
please try to check the javascript from where this pop-up is executing and try to disable display property by setting it to none
Try to remove this div class name "_355Q0" from DOM. by using this javascript query.
var myobj = document.querySelector("._355Q0")
myobj.remove();

How to add a onclick pop up form on a page?

When someone clicks on a button then a pop up form will appear.
I am trying to do but don't know how to fix it.
You can open new popup window form by javascript as you have to
call following with onclick event of your button
window.open(url, 'new tab', 'width=700,height=500');
You can also close this popup window after success of form submission by following
window.close(url);
In url you have to add your url.
If this is not work please share more information. thank you

use OnClientClick on bootstrap modal to avoid postback

Am using vb.net in asp.net to create my project. I use also a bootstrap modal to get data from client.
In the modal I have buttons and textboxes that get the data from user. there is a FINISH button that ends the process and closes the modal
the problem is that the other buttons are not supposed to close the modal, but make some calculations and processes. At one hand I need the postback in order to tiger the events of the buttons, And at the other hand the post back closes the modal, and i have to re-open it at the end of each process. This action makes the modal close and re-open after each click, and it is not Nice or Convenient
I thought that if I disable the postback of the buttons, and use the OnClientClick to catch the client click, this will work for me. But the Question is how can I make the OnClientClick Call a server side code (Sub)?
Any other Suggestions are welcome :)
OnClientClick is just that the CLIENT CLICK it doesn't translate into a server side method. Each ASP.Net server control has an OnClick event which is associated with a server based method, but that would give you the exact same scenario that you're dealing with now.
In this situation, I would have the secondary buttons (i.e. the ones that don't close the modal by behavior) use AJAX to send/receive data from the server (accessing an ASHX file or some other handler/WebAPI). This removes the entire postback situation entirely which sidesteps the issue.

How can I give focus to WinJS.UI.settingsFlyout after animation?

I'm invoking a WinJS.UI.settingsFlyout element via Javascript using WinJS. Inside the HTML element of the settingsFlyout, I have a text input field that I would like to receive focus after the animation of the flyout occurs. I've tried to use jQuery's .focus() method, but it does not work because I do not think the flyout is focused after it completes its animation. I have to click twice on the input field to begin typing. I click once to get the flyout in focus, and then click another time to get the field in focus. Quite annoying. Is there a way to implement auto focusing of input fields within a WinJS.UI.settingsFlyout?
Have you tried?
settingsFlyout.addEventListener("aftershow", function(){
$('#inputId').focus();
});

OOB NewForm in Dialog loses focus after a few seconds

Working in SharePoint 2010, with SharePoint Designer 2010, I have a DispForm to which I've added a DVWP that displays a filtered view of another relative list. The DVWP has a 'New' link which opens the NewForm for that list in a modal dialog, using OpenPopUpPage (http://msdn.microsoft.com/en-us/library/ff410825.aspx).
After 5 - 12 seconds, the blinking cursor disappears from the first control and the focus switches to the 'Close' button. If the user was trying to type and happens to hit the Enter key when the focus switches to the 'Close' button, the background is no longer darkened and the 'Cancel' button no longer works. The form is still displayed on the screen, and the user can 'Save' but the modal never goes away until the page is refreshed.
If the user notices that the modal has lost focus and clicked back on the form, everything works as it should and all is well.
Observations:
When the control/modal loses focus, the 'Close' button does not trigger a 'focusin' event. But, $(document.activeElement).attr("value") displayed in the console shows that it's the active element.
Questions:
Why is the modal losing focus?
Does anyone have a Javascript/jQuery workaround to capture the event and set the focus back where it was?
Alternately, what if I lock the form and wait for this focus-change to complete, then unlock it and set the focus on the first field? Ideas?
You may be having a problem if the DispForm is also a dialog and you open the modal with your script. It sounds like you are getting a "layered" effect. My guess is that the script managing the dialog is interfering with the modal. Have you tried turning off the dialiogs for the list?
Just so I get some points on this site, the affliction was the asynchronous refresh of the first modal. It was taking the focus away from the layered modal.
Thanks JB for the answer!
I figured out the problem: the DVWP was using Auto-Refresh with the Async Update. This was running every 15 secs, taking the focus away from the modal, then not returning it to the last control.
So, we turned of the auto-refresh and used the callback from the modal close to trigger a click on the manual refresh button instead.