?
Solved

Passing values from Gridview to ModalPopUp Extender

Posted on 2009-04-03
12
Medium Priority
?
837 Views
Last Modified: 2013-12-17
In my project I have a Gridview with 10 Artist rows in it.
When the user clicks on one of the row a modalpopupextender is opened.
when the user clicks on the modal popup extender it will take the user to next window
based on ArtistId.
My question here is how to pass the ArtistId to Modalpopupextender when the user
clicks on the Artist row in the Gridview.
Any help will be highly appreciated.

<ItemTemplate>
	   <asp:HyperLink ID="lnkArtist" runat="server" NavigateUrl='www.yahoo.com' Text='ArtistName' />                
              <asp:LinkButton ID="lnkPopup" runat="server" Width="47px" style="display:none" />
     
                <cc1:ModalPopupExtender ID="ModalPopup1" runat="server" TargetControlID="lnkArtist"
                    PopupControlID="pnlpopup" BackgroundCssClass="modalBackground" 
                    OkControlID="btnSelect1" CancelControlID="CancelBtn" /><br />
        
		<div style="width:350px; margin:auto; margin-bottom:10px;">
                     <div style="margin-top:20px;"><strong>Do You Want To View This Artist:</strong></div>                    
                    </div>
                    
         	<div style="width:300px; margin:auto;">                                    
                   <div style="margin-top:20px; clear:both;"><asp:ImageButton ID="btnSelect2" OnClick="btnSelect2_Click" ImageUrl="~/Images/select.gif" runat="server"/> 				<strong>ClickMe</strong></div>
                   </div>
	    </asp:Panel>
	 </ItemTemplate>

Open in new window

0
Comment
Question by:ken_rgr
[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
  • 6
  • 6
12 Comments
 
LVL 27

Expert Comment

by:nmarun
ID: 24064205
0
 

Author Comment

by:ken_rgr
ID: 24064763
I tried it. but its not working for me.
0
 
LVL 27

Expert Comment

by:nmarun
ID: 24064822
0
Basic Security of Your VPC

So, you’ve got this shiny new VPC and a fancy new application configured on your EC2 servers ready to go. This application is only accessible from your computer, which is great for security, but you need your users to be able to access it! So, what’s the easiest way to do this?

 

Author Comment

by:ken_rgr
ID: 24078872
I am trying in the same way
here is my script.

 function lnkArtistClick(key)
    {
        var Grid1 = document.getElementsByTagName('GridView');    //getElementById('Gridtable');
        var field1 = Grid1.getElementsByTagName('INPUT');
        for (var i = 0; i < field1.length; i++) {
            if (field1[i].type == "HiddenField") {
                alert(field1[i].value);
               
            }
        }        
    }

In the above code  document.getElementsByTagName('GridView');    is returning count 0.
I tried document.getElementById('Gridtable'); also returns null.
I dont know where I am doing mistake.
0
 
LVL 27

Expert Comment

by:nmarun
ID: 24078900
You need to something like this:

var Grid1 = document.getElementById( '<%=gridView1.ClientID %>');
0
 

Author Comment

by:ken_rgr
ID: 24079910
Hi

Thanks man. its working good now.
But I am not getting the Hidden field value now.
Basically the hidden field is in the <itemtemplate> of the gridview.
Any suggestions.
thanks
0
 
LVL 27

Expert Comment

by:nmarun
ID: 24080097
How about?
var hiddenField = document.getElementById( '<%=myHiddenField.ClientID %>');
0
 

Author Comment

by:ken_rgr
ID: 24080518
Nope , I am not getting the error "myHiddenField does not exists in the current context."
Remember Hidden field is in the Gridview. We can not access is directly.
We have to access it from Gridview only.
Please check earlier code.
Thanks
0
 
LVL 27

Expert Comment

by:nmarun
ID: 24081126
Replace 'myHiddenField' with the name you have specified in your code.
0
 

Author Comment

by:ken_rgr
ID: 24081256
Thats what I did.
0
 
LVL 27

Accepted Solution

by:
nmarun earned 1500 total points
ID: 24081294
0
 

Author Closing Comment

by:ken_rgr
ID: 31566418
Appreciated your help.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

800 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