Click here to Skip to main content
15,896,726 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi,
Im placing UserControl(ASCX) file two times in aspx page. but the issue is the the functionality of first one is working but second is not working.
Pleae let me know.

Here is my code follows.

ASP.NET
<div>
        <uc1:DisplayGridControl ID="DisplayGridControl1"  runat="server" />
    </div>
    <div>
        <uc1:DisplayGridControl ID="DisplayGridControl2"  runat="server" />
    </div>



Thanks in advance.
Posted
Comments
Sushil Mate 18-Oct-12 7:41am    
give them unique name. what does it mean not working?
Sanjeev Alamuri 18-Oct-12 7:52am    
ASP Button click functionality not working even though unique name and ids provided.
Sushil Mate 18-Oct-12 7:56am    
can you enlighten more on this issue.. what exactly you wanted to do here?
whats the relation between your usercontrol & asp button click?
Sanjeev Alamuri 18-Oct-12 8:04am    
ASP Button which resides in control.
<asp:Button ID="btnSubmit" runat="server" OnClick="btnSubmit_OnClick" Text="Click" />.
Based upon requirement im going to add the same control twice in aspx page. here for the first control the functionality is fine. but nothing is going to happen in the second.

1 solution

Hi,

try this javascript function in your user control page.

JavaScript
<script type="text/javascript">
    function cellSelected(sender, args) {
        var mediaUrl = args.get_gridDataItem().getDataKeyValue("MediaUrl");
        document.getElementById("<% =hdnMediaUrl.ClientID %>").value = mediaUrl;
    }

    function cellDeselected(sender, args) {
    var mediaUrl = args.get_gridDataItem().getDataKeyValue("MediaUrl");
    document.getElementById("<% =hdnMediaUrl.ClientID %>").value = '';
    }
    
</script>


then let me know if it is working or not.

Thanks
Tapan kumar
 
Share this answer
 
v2
Comments
Sanjeev Alamuri 18-Oct-12 7:57am    
Thanks Mr. Tapan Kumar, here script is working fine. but the issue is Code side functionality is not working.
tarun kumar sahoo 18-Oct-12 10:42am    
thanks tapan
fjdiewornncalwe 18-Oct-12 15:56pm    
My 1: Sock-puppet vote.
Kill the BUG 18-Oct-12 10:45am    
thanks Tapan
fjdiewornncalwe 18-Oct-12 16:03pm    
Another sock puppet

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900