COMMUNITY: How to properly ask a question on Forums
Become a member
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forum guidelines
Ye Htut
1.5k
59
12.6k
Fire textchanged event in javascript asp.net c#
Sep 27 2016 10:53 PM
in my application, I used asp.net Repeater with table to populate item from database and DropDownExtender of Ajax. When user clicks on textbox, data with html data've been shown.Now I want to fire textchanged event of textbox when data row is selected. I bind data to repeater in page_load.
Thanks All
What I have tried:
in javascript
function SetValue(value) {
var DropdownList = document.getElementById("<%=ddlItemID.ClientID %>");
// txtFriend.value = value;
alert(value);
}
at repeater, I tried like this
<asp:Repeater ID="rptr" runat="server">
<HeaderTemplate>
<table style="border: 1px solid black;" >
<tr style="border: 1px solid black;">
<th style="border: 1px solid black;">
ID
</th>
<th style="border: 1px solid black;">
Unit
</th>
<th style="border: 1px solid black;">
Price
</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr onclick="SetValue('<%#Eval("ID")%>')" style="cursor: hand" onmouseover="style.backgroundColor='#bfb9b9'"
onmouseout="style.backgroundColor=''" style="border: 1px solid black;">
<td style="border: 1px solid black;">
<%#Eval("ID")%>
</td>
<td style="border: 1px solid black;">
<asp:Label ID="lbFirstName" Text='<%#Eval("Unit")%>' runat="server" />
</td>
<td style="border: 1px solid black;">
<asp:Label ID="lblLastName" Text='<%#Eval("Price")%>' runat="server" />
</td>
</tr>
</ItemTemplate>
<AlternatingItemTemplate>
<tr onclick="SetValue('<%#Eval("ID")%>')" style="cursor: hand" onmouseover="style.backgroundColor='#fff4f4'"
onmouseout="style.backgroundColor=''" style="border: 1px solid black;">
<td style="border: 1px solid black;">
<%#Eval("ID")%>
</td>
<td style="border: 1px solid black;">
<asp:Label ID="lbFirstName1" Text='<%#Eval("Unit")%>' runat="server" />
</td>
<td style="border: 1px solid black;">
<asp:Label ID="lblLastName1" Text='<%#Eval("Price")%>' runat="server" />
</td>
</tr>
</AlternatingItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
Reply
Answers (
3
)
how to loop through hidden courses and remove from database
Hosting Time Parser Error
"