473,396 Members | 1,786 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Detailsview inside ModalPopup

I have a DetailsView inside a ModalPopup (using the AJAX
ModalPopupExtender).

I would like the user to have the ability to change the DetailsView's
mode within the ModalPopup.
But whenever I click the button to change the mode, the ModalPopup
closes itself. The NEXT time I open the ModalPopup, the mode has been
changed. So the mode is changing... my problem is that I need the
ModalPopup to stay visible.
Also, the DetailsView is inside an UpdatePanel within the Panel I am
popping up. The ModalPopupExtender's OKControlID and CancelControlID
are not within this UpdatePanel (but are inside the Panel).

I have downloaded an example that suggests that what I am trying to do
should work... am I misunderstanding something?

Code:

Target control:

<asp:LinkButton ID="lbtn" runat="server" Text="Modal"></
asp:LinkButton>
<cc1:ModalPopupExtender ID="modal" runat="server"
TargetControlID="lbtn" PopupControlID="pnl" DropShadow="true"
Drag="true" CancelControlID="btnCancel" OkControlID="btnOk"
BackgroundCssClass="modalBackground">
</cc1:ModalPopupExtender>

Panel:

<asp:Panel ID="pnl" runat="server" Height="400px" Width="900px"
BackColor="Khaki">
<asp:UpdatePanel ID="UpdatePanel9" runat="server">
<ContentTemplate>
<asp:DetailsView ID="dv" runat="server" Width="100%" DataKeyNames="ID"
DataSourceID="ds" DefaultMode="ReadOnly" AutoGenerateRows="false">
<Fields>
....
</Fields>
<FooterTemplate>
// Buttons that change the mode
</FooterTemplate>
</asp:DetailsView>
</ContentTemplate>
</asp:UpdatePanel>
<asp:Button ID="btnOk" runat="server" Text="OK" />
<asp:Button ID="btnCancel" runat="server" Text="Cancel" />
</asp:Panel>
<
Dec 20 '07 #1
1 7171
On Dec 20, 5:14 pm, gsauns <gsa...@gmail.comwrote:
...whenever I click the button to change the mode, the ModalPopup
closes itself. The NEXT time I open the ModalPopup, the mode has been
changed. So the mode is changing... my problem is that I need the
ModalPopup to stay visible.
I've had this problem before. You need to reopen the modal popup on
the server side in the DetailView's ItemUpdating event:

Protected Sub gsaunsdv_ItemUpdating(ByVal sender As Object, _
ByVal e As System.Web.UI.WebControls.DetailsViewUpdateEventAr gs) _
Handles <DETAILSVIEW-ID>.ItemUpdating
<MODAL-ID>.Show()
End Sub

You may want to do that in other events too (such as ItemInserting).
Also, the DetailsView is inside an UpdatePanel within the Panel I am
popping up. The ModalPopupExtender's OKControlID and CancelControlID
are not within this UpdatePanel (but are inside the Panel).
I would just put all of that in the UpdatePanel to avoid problems.

-Michael Placentra II
Dec 23 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Jim Hammond | last post by:
I am passing the whole object instead or parameters in my select and update methods. I can get the updated object if I set UpdateMethod, let ASP.NET autogenerate an update button, and then press...
3
by: chrisn | last post by:
Hi, (Using ASP.Net 2.0) I have a wizard control inside a detailsview control. When I attempt to call the InsertItem method on the DetailsView I get an error "ObjectDataSource...
5
by: Darth Continent | last post by:
Hello, I'm trying to replicate the functionality presented here specific to the ModalPopup control: http://ajax.asp.net/ajaxtoolkit/ModalPopup/ModalPopup.aspx I've created a C# Ajax-enabled...
2
by: mike | last post by:
I have a page with a LoginView which contains a Gridview and a DetailsView, each in its own UpdatePanel The problem that I am experiencing is that when I select a record in the Gridview (using a...
0
by: gsauns | last post by:
I have a DetailsView which is inside of a FormView. I lifted this DetailsView straight off another one of my pages, where it was working beautifully. Now I get this endlessly frustrating error...
1
by: ajrock2000 | last post by:
I am using a DetailsView to display some data. I am basically getting a firstname, and lastname fields from a database (the database cannot be changed, nor the queries), and I must concatenate the ,...
5
by: =?Utf-8?B?bXBhaW5l?= | last post by:
Hello, I am completely lost as to why I can't update a DropDownList inside a DetailsView after I perform an insert into an object datasource. I tried to simply it down to the core demostration:...
0
by: =?Utf-8?B?U2F2dm91bGlkaXMgSW9yZGFuaXM=?= | last post by:
In VS2008, I have a DetailsView control with a checkboxlist control inside its Edit template. (1) I want the checkboxlist to be dynamic and display only as many checkboxes as a user setting is...
1
by: semomaniz | last post by:
I have a button inside a repeater which is supposed to open a popup when clicked. But when i click on the button my modalpopup does not open. The strange thing is on the code provided below if i...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.