Hi,
I make some code for your requirement .Just try that If you interested then make some changes to that and use it.
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
<script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
<script language ="javascript" >
function f1(tid) {
tid.innerText = ""
}
</script>
</head>
<body >
<form id="form1" runat="server">
<div>
<asp:datalist id="DataList1" runat="server" xmlns:asp="#unknown">
onitemcommand="DataList1_ItemCommand"
onitemdatabound="DataList1_ItemDataBound" >
<HeaderTemplate > <table>
</HeaderTemplate>
<itemtemplate>
<tr>
<td>
<asp:textbox id="TextBox1" runat="server"></asp:textbox>
</td>
<td>
<asp:linkbutton id="LinkButton1" runat="server" commandname="save" commandargument="2">save</asp:linkbutton>
</td>
</tr>
</itemtemplate>
<footertemplate>
</footertemplate></table>
</asp:datalist>
</div>
</form>
</body>
</html>
The code behind file contains following code
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
List<string> g = new List<string>();
g.Add("hjghj");
g.Add("hjghj");
g.Add("hjghj");
g.Add("hjghj");
g.Add("hjghj");
g.Add("hjghj");
g.Add("hjghj");
DataList1.DataSource = g;
DataList1.DataBind();
}
}
protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName == "save")
{
}
}
protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
TextBox rdblist = (TextBox )e.Item.FindControl("TextBox1");
LinkButton lblqid = (LinkButton)e.Item.FindControl("LinkButton1");
lblqid.OnClientClick = "f1("+rdblist.ClientID +")";
}
}
</string></string>
Here you've to change some code according to your requirement.
I hope you understood What I write
All the Best