Showing posts with label cancel. Show all posts
Showing posts with label cancel. Show all posts

Monday, March 26, 2012

DetailsView in a modalpopup

Hello,

i am using a detailsview in a modalpopup. When i click edit in the detailsview, the popup closes again. I have a cancel button separately to close the popup. How do i prevent the popup from closing when i press the Detailsview?

thanks for your kind help.

Maurice

I am having a very similiar problem as you.

I have a usercontrol that contains some textbox's, a button and a gridview.

When I click the button I filter the gridview based on content from the textbox's

The usercontrol is inside a modalpopup. When I click on the button, the modalpopup disappears. The popup should not disappear!


I started to encounter this problem after I upgraded from Beta2 to RTM of AJAX.NET Extensions and got the latest version of the Control Toolkit.

Is there anyone with any solutions?!?


Hi,

ModalPopup will hide whenever a postback occurs (well, technically it doesn't hide but rather it won't be shown again). If the content of your ModalPopup is causing postbacks, you should wrap it in an UpdatePanel (just the content of the ModalPopup - not the whole ModalPopup itself) so the popup remains visible.

Thanks,
Ted


Hi, I have a modal popup which shows search results.It uses updatepanel as you mentioned and on a button click I fill an asp-repeater control.

After searching (repeater is populated), if I click the cancel button of the popupextender then

the dropdown boxes on the page remain invisible..Is this a bug ? appreciate any solution. Thanks.

DetailsView & ObjectDataSource: Cancel Insert but Retain User Input

Hi,

I need to cancel an insert operation during a DetailsView/ObjectDataSource insert event, and display to the user the same insert page with their previously entered values. For example, after a server side input validation the user may need to modify some of the values they entered.

Canceling insert is easy in the ObjectDataSource.Inserting event handler: e.Cancel = true;

However, this cancels insert mode and the values the user input are lost. The ObjectDataSource.Inserting event handler has access to the input parameters, which contain the values the user has entered. It is possible to put the DetailsView object back into insert mode: DetailsView1.DefaultMode = DetailsViewMode.Insert; but I don't know how to programatically assign the user values to the fields, since I do not know how to get a handle to the field.

How does one retain the user input values in insert mode when canceling an inserting event in the DetailsView/ObjectDataSource programming model?

Thanks,

Paul

You should validate the input values in the DetailsView ItemInserting event, rather than in the ObjectDataSource Inserting event. In such case the input values will be retained though you cancel the inserting event

protected void DetailsView1_ItemInserting (object sender, DetailsViewInsertEventArgs e)
{
// validate
e.Cancel = true;
}

Thanks

-Mark post(s) as "Answer" that helped you