how to get the TargetControlID from code behind?

There is a page with two images connect to same popupcontrolextender. The code looks like:

<img id="img1" src="../images/Comments.jpg" runat="server" />
<ajax:PopupControlExtender ID="PopupControlExtender1" runat="server" TargetControlID="img1"  PopupControlID="PanelPopup" Position="Bottom" />

<img id="img2" src="../images/Comments.jpg" runat="server" />
<ajax:PopupControlExtender ID="PopupControlExtender2" runat="server" TargetControlID="img2"  PopupControlID="PanelPopup" Position="Bottom" />

<asp:Panel ID="PanelPopup" runat="server" CssClass="popupControl1">
            <asp:UpdatePanel ID="UpdatePanel1" runat="server" RenderMode="Inline" UpdateMode="Conditional">
                        <uc1:mycontrol ID="mycontrol1" runat="server" OnLoad="mycode" />

 How can I know which image is clicked when user trigger  the popup control on the display in codebehind at runtime?

4/30/2008 4:10:17 PM 9760 articles. 0 followers. Follow

2 Replies

Similar Articles

[PageSpeed] 37
Get it on Google Play
Get it on Apple App Store

Havent tried that one, but perhaps you can look at Request.Form["__EVENTTARGET"]? 

4/30/2008 6:50:28 PM


The beauty of the popup extender is that it is implemented all in client-side code, without an expensive postback.  It sounds, however, like this doesn't really work for your scenario.

I don't think there is an easy way to coerce the popup extender to work the way you want.  What you can do instead, however, is use two different popup panels, one for each image (or more if you need to) and just make them behave differently.

On the other hand, if you don't know how many images will be in your page initially, this could get complicated. 


James Ashley, Magenic Technologies
4/30/2008 7:29:07 PM

Similar Artilces:

Code behind vrs. non code behind in VS.NET 2003
Does anyone know what the advantages and disadvantages are for using code behind vrs. non code behind in Visual Studio.Net 2003? One important difference is that you are able to separate the design of a web site from the code. This makes for ease of maintainablity and much more structured applications. If you ever worked with classic ASP the code-behind is a great invention. sivilianMy Weblogs...

Converting classic to .NET 2 code, and .NET gets an error back from ADS?
 For future-proofing, our Internal Phone Directory is being moved onto our AD servers, and obviously we're using LDAP for queries.To get the phoneboook queries working, I adapted the current classic ASP code to use LDAP, and that works fine. However, we're wanting to move these pages to .NET, and that's where the problem comes in. Using the same basic logic from the Classic code (90% of its unchanged) to produce an LDAP query, I get the error  155 Unknown error (0x80005000)This is using the same website, and so the same credentials  - unless aspx pages run und...

How to convert C#.Net code to VB.Net code ???...
HI, i was searching something new, then i suddenly find some tips to convert C#.Net code to VB.Net but i did not do well. i am puttint its url here plz tell me how to convert C#.Net code to VB.Net. Jasim...Please remember to click “Mark as Answer” on the post that helps youJasim AkhtarNew Delhi ( INDIA ) It would be better if you write the problem you having, while converting from C# to VB.NET. You cannot completely rely on online converters. ThanksMark post(s) as "Answer" that helped youElectronic ScrewWebsite||Bl...

Translate code to code
Hi I can usually do the translation myself, but this time I am a bit stumped  Let us consider to rewrite Urls (more than 16000 links) using a table. Save original url and rewritten url in a table. Now add a class file in App_Code folder. class UrlRewriteModule : IHttpModule{    public void Dispose()    {        // Nothing to dispose    }    public void Init(HttpApplication context)    {        context.BeginRequest += new EventHandler(context...

use VB.NET and C#.NET code in the same C#.NET project
All-- Here is a sample that is "off the beaten path", (at least for me). Is it possible, in an ASP.NET application, using the code-behind page building technique, to have both pages written in VB.NET and pages written C#.NET?At there is a sample that shows that, (contrary to popular belief), it IS possible to mix ASP.NET pages built with C#.NET with ASP.NET pages built with VB.NET in the same VS.NET 2003 project. Note that this is just a "fun" sample to see if it can be done and I do not recommend this practice as a "standard" way of develo...

get html textbox value in behind)
  i am new to Can anybody say how to get Input textbox value in b4 sending answer Thankx  string value = Resquest.Form["textboxname"].ToString(); Hi,There are two ways to access it. 1) Make it runat="server" and access it in code behind like textbox1.value2) Another way is by using     Request.Form["textbox1"].ToString(); I hope this will be helpful to you.Thanks, Alpesh DhaneshaPlease don't forget to "Mask as Answer" if it helped. just add runat =server to html  ...

------_=_NextPart_001_01C6429F.D89AA417 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello, Net::LDAP Net::LDAPS Is there a possible to LDAP bind with an encrypted (SHA, SSHA, CRYPT, ....) password? I don't like to write the secret password to the perl file. Best regards Barbara Wilbert ------_=_NextPart_001_01C6429F.D89AA417-- Wilbert Barbara (CI/OSI) * wrote: > Hello, > > Net::LDAP > Net::LDAPS > > Is there a possible to LDAP bind with an encrypted (SHA, SSHA, CRYPT, > ......

Paging in AP.NET/VB.NET
Hi All, Well... a simple problem perhaps regarding paging in an application using I have a datagrid named dgResult and being trying to implement paging on it.  Following is the code to capture the PageIndexChanged event. Sub dgResult_PageIndexChanged(ByVal sender As Object, ByVal e As DataGridPageChangedEventArgs) Handles dgResult.PageIndexChanged dgResult.CurrentPageIndex = e.NewPageIndex GetProperData() End Sub I have a break point at dgResult.Curre.... position.  The datagrid, just do not accept the method and I can not event trap the event using a break ...

Starting an Application in .net
i am new to could any one give me simple ajax,net example so that i start building on my ajax skills please.........  I started with the todolist video on the main page, and its all you need to know to get started. Don't forget to click "Mark as Answer" on the post that helped you.This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.    ...

How do you code yours? Design Time or Code Behind (.net 2.0)?
What’s your preferred method when coding?   I have noticed in a lot of books and even the Quick start Tutorials section of the site they use Design Time examples using Drag and Drop examples with visual studio. Surely having code in your .aspx file such as asp:ObjectDataSource is not the best method. Surley the best method is to use classes with code behind?   Your comments would be very much appreciated.   Thanks   WD ThanksWDRocket Whois - IMO, it depends on what you are doing. If you are creating one web form or a very small sit...

Old AJAX in .NET 1.1 compatibility with .NET framework 2.0. Ajax does not work always ....................
Hello,I have converted the web site from .NET 1.1 to .NET 2.0. Some of the pages in the web site use AJAX which was developed in .NET 1.1Ajax does not work smoothly in .NET 2.0. Do I have to use ATLAS or is there any fix I can use to make the AJAX work ?Please let me know. Many thanks in advance. Nick..........

Does anyone know of either an blog available or an 'inline editor' for
Hey all:  I'm desperately trying to find an AJAX control (I don't care if it's currently for ASP.NET AJAX.NET, since if not, I'll do the conversion and make it available to others) for creating blogs and another inline editor control, so that if there is text on the page, I can click on the text and it will automatically display an editor and allow me to edit the text/html.  Does anyone know of a control like this that's AJAX enabled?  Especially AJAX.NET.  I'm only interested in open-source, since any improvements I make I will make available on Thanks in...

I am not getting my mail open on my net as net is running
Name: Email: rmbala91atgmaildotcom Product: Firefox Summary: I am not getting my mail open on my net as net is running Comments: My mail is not getting opening. Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20100401 Firefox/3.6.3 From URL: Note to readers: Hendrix gives no expectation of a response to this feedback but if you wish to provide one you must BCC (not CC) the sender for them to see it. ...

How to get RS (From VB6) to .NET (VB.NET)
Hi Friends,         I have requirement, there is one function in VB6 it returns a RS, I need to call that function in  VB.NET, how to get those values into .NET, if can any body can help (pass me some code snippets), that will be greate, Thank you.Madhu... -Madhu hey guys i got this one just by using fill method.-Madhu...

Web resources about - how to get the TargetControlID from code behind? -

DropDown Sample
Samples HOME Accordion AjaxFileUpload AlwaysVisibleControl Animation AreaChart AsyncFileUpload AutoComplete BalloonPopup BarChart BubbleChart ...

Resources last updated: 1/18/2016 3:08:51 AM