Click here to Skip to main content
15,881,803 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hii.........

I want to find The Id of a Server Control which exists in a Repeater.
I want to perform some action on the click event of that button to perform some functionality on click event.

Thanks In Advance........
Posted
Updated 10-Oct-11 23:13pm
v2
Comments
hitech_s 11-Oct-11 3:33am    
is button inside the repeator or outside the repeator?

1 solution

Hi,

can you post your code.

you can retrieve specific control data in repeater by javascript.

But we've to mention how many rows and howmany columns in repeater is important.

And one more thing is button place either it is in data control or outside the data control

Here I'm providing simple code for retrieving particular cell value in javascript

ASP.NET
<itemtemplate>
            <tr>
                <td önclick="f1(this,<%#Eval("compid") %>)">
                    <asp:Label ID="Lbluid" runat="server" Text='<%#Eval("compid") %>'>
                </td>
                <td önclick="f1(this,<%#Eval("compid") %>)">
                    <asp:Label ID="Lblpid" runat="server" Text='<%#Eval("compname") %>'>
                </td>
                <td önclick="f1(this,<%#Eval("compid") %>)">
                    <asp:Label ID="Label1" runat="server" Text='<%#Eval("compoffaddr") %>'>
                </td>
                <td önclick="f1(this,<%#Eval("compid") %>)">
                    <%#Eval("compsiteurl")%>
                </td>
            </tr>
        </itemtemplate>


And javascript contains following code
JavaScript
function f1(tid, asr) {
    alert("Your selected Company ID is : " + asr + ";  Your selected Cell Values is : " + tid.innerText);
}


I hope you understood how we can get particular cell in data controls through javascript

we can achieve this based on our datacontrol how it designed ,howmany coloumns...

All the Best
 
Share this answer
 
v2

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



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