Solved

ModalPopup TargetControlID is a Control Inside a DetailsView

Posted on 2007-04-10
4
2,153 Views
Last Modified: 2008-01-09
Hi,

I have a details view which I am using in Insert Mode to insert a record into a DB. One of the fields in my DetailsView is a DropDownList, next to the DDL is a LinkButton. I would like a Modal PopUp to appear when that LinkButton is clicked, which allows the user to quickly add something to the DropDownList.

 I have it all working when my LinkButton which I am using as the TargetControlID is outside of my DetailsView, but when it is in the DetailsView, and I change the TargetControlID to use it's full name, the Modal PopUp appears, but then closes. It's only on the screen for a few milliseconds.

I have two LinkButtons, one inside the DetailsView, another outside the DetailsView, the outside one is hidden, I then use the OnClientClick method to force the hidden LinkButton to be clicked when the link button inside the DetailsView is clicked.

 Here is some of my code:

 <asp:LinkButton ID="cmdAddNewEvidenceType" runat="server" OnClientClick="ctl00_cphBodyText_cmdHiddenAddNewEvidenceType.click();" Text="Add New" />

<

asp:LinkButton ID="cmdHiddenAddNewEvidenceType" runat="server" Style="visibility: hidden" />

<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender" runat="server" TargetControlID="cmdHiddenAddNewEvidenceType"

PopupControlID="palAddEvidenceItemType" BackgroundCssClass="modalBackground" CancelControlID="cmdCancelAdd"

DropShadow="True" PopupDragHandleControlID="palHeader">

</ajaxToolkit:ModalPopupExtender>
 Thanks

 Andrew
0
Comment
Question by:ttnetworks
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 7

Accepted Solution

by:
here4u247 earned 500 total points
ID: 18881130
hey Andrew,

what you can do is find out what the dynamic ID the .net gives your cancel/ok button that are inside the details view and assign them in the CancelControlID or OkControlID, usually the ID that .net generates are somewhat like:

MyDetailsview1$MyOkButtonID


hope that make sense...
0
 

Author Comment

by:ttnetworks
ID: 18882598
That's not really what I am after, my OK and Cancel buttons work fine, they do everything I want them to do.

What I am trying to do is get the Modal PopUp to be triggered from a LinkButton inside a DetailsView.

I have tried to use the ID .Net Generates, but either I am getting the ID or wrong, or the TargetControlID does not support them, as it does not seem to want to work!!

Andrew
0
 
LVL 7

Expert Comment

by:here4u247
ID: 18882884
you can assign the .net generated id, i've tried it many times, now where did you place the DetailsView? can i see your code structure?
0
 

Author Comment

by:ttnetworks
ID: 18898876
Alright, got it working with the full unique control ID. I was missing the Content Place Holder tag. I'll close this now, but I have a new AJAX problem!
0

Featured Post

Ready to get started with anonymous questions?

It's easy! Check out this step-by-step guide for asking an anonymous question on Experts Exchange.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question