I am currently working on an ASP.net c# project. I have an aspx page where I have a form taking user input and a datagrid. When the user clicks on a link inside the datagrid it displays a modal popup extender with dynamic data. This is working fine.
What I want to be able to do is when the modal popup extender is opened it has a form that can also take user input. However, I am having a problem that when I try to enter data into the form in the modal popup extender and i press the submit button it is first checking the form on the proper page, not in the modal popup extender, which is preventing the form on the modal popup extender from being submitted.
How can I get around this issue?
I assume it's firing validators on the form on the main page and not allowing you to submit the modal form?
If that's the case you can change the form on your main page to use a different ValidationGroup so it doesn't fire when you submit the modal form.
Related
So basically, I have a C# winform and it has multiple pages (which are different forms) when going to one page to another it closes the previous form/page. However, I have a “Settings” page and on that form I have a toggle button. That toggle button changes the text of a label on form1. If I force the form the open while the “settings” form is open, the text changes. However, I do NOT want that form to actually open I just want the text to change but when I take out the form1.Show(); , and just toggle the button off and switch back to form1 the text is the original and when switching back to settings, the toggle button has re-enabled itself. I cannot figure this out.
I have just implemented a modal popup on my site to capture email addresses. Once the user clicks the submit button the form is submitted. I am calling the modal again after a page.ispostback which works fine. However, I only want it to display after a user clicks that particular submit button. As this is on a master page, if someone goes to my 'Contact Us' page and submits a question on postback the modal reappears which I don't want. I literally only want it to appear after a postback from the submit form on the modal.
Any ideas how I can get around this?
Thanks
Rob
To display the modal only after the user clicks the submit button, you should put the modal's display logic only in this button's submit event.
Take the logic out of the Page_Load's IsPostBack, and put it at the end of this button's OnClick event
protected void Button_Click(object sender, EventArgs e)
{
// Do some work...
// Show modal
}
I have a row of buttons on a web page, each of which is to invoke a Model dialogue to display further details. I am displaying the modal dialogue thus:-
winArgs = window.showModalDialog('MyDialogue.aspx', winArgs, winSettings);
and when I do this, the codebehind detects the data it is supposed to display and displays it on the Modal dialogue. I then close this down with the red X, and click another button to display a different dataset, but no codebehind methods are invoked, and consequently the dialogue displays the previous dataset.
I guess there is nothing that can be done about this on closing (that is a client event), so what I need to know is how do I either:-
create a new modal dialogue with the showModalDialog and not re-use the existing one,
or, invoke some function in the code-behind when the dialogue pops up?
i have a grid view on a page and i have webusercontrol which contains the registration for and this usercontrol open in a popup and when i click finish submit of registration this will add the new entry in database. but my grid still show previos records untill i refresh the page . so how can i rebind the grid on click of Submit button of user control?
thanks
You need to refresh parent page on popup window closing.
This link would be help. Closing-child-pop-up-and-refreshing-parent-page
Or you can check the javascript code below.
function refreshParent() {
window.opener.location.href = window.opener.location.href;
if (window.opener.progressWindow)
{
window.opener.progressWindow.close()
}
window.close();
}
I have a UserControl where I have some buttons and textboxes. I was wondering how I can display that UserControl when a user clicks a button.
A user control cannot be a 'popup window', that requires a toplevel window. A form. You can put the user control in a form and use the form's Show() method to make it visible.
Fwiw, turning a user control into a toplevel window is technically possible with the SetTopLevel() method. It isn't worth the hassle, it won't behave like a proper one.
You should paste the user control on a windows form and then make it a modal window. Make a object of that form and then call object.open();