B
bushi
hi !
i have following code to display some text on a web form,after
getting it from database.
<aspataList ID="DataList1" runat="server"
DataSourceID="SqlDataSource1">
<ItemTemplate>
<asp:LinkButton ID="links" runat="server" Text='<%#
Eval("links") %>' OnClick="LinkButton1_Click"></asp:LinkButton><br />
<asp:Label ID="textLabel" runat="server" Text='<%#
Eval("text") %>' ForeColor="DarkSlateBlue"></asp:Label><br />
<asp:Label ID="urlsLabel" runat="server" Text='<%#
Eval("urls") %>' ForeColor="DarkSeaGreen"></asp:Label><br />
<asp:HiddenField ID="page" runat="server" Value='<%#
Eval("page_ref") %>'></asp:HiddenField><br />
<br />
</ItemTemplate>
</aspataList>
and i want to access the value of hiddenfield in my aspx.cs file for
some manipulation.for this purpose i'm using the following code:
for(i=0;i<DataList1.items.count;i++)
{
HiddenField hd = (HiddenField)DataList1.Items[2].FindControl("page");
string s = (hd.Value) as string;
}
its giving me the whole record of datalist.but i want to get only the
selected item against my record.
any one have idea about it,plz rply me.
i have following code to display some text on a web form,after
getting it from database.
<aspataList ID="DataList1" runat="server"
DataSourceID="SqlDataSource1">
<ItemTemplate>
<asp:LinkButton ID="links" runat="server" Text='<%#
Eval("links") %>' OnClick="LinkButton1_Click"></asp:LinkButton><br />
<asp:Label ID="textLabel" runat="server" Text='<%#
Eval("text") %>' ForeColor="DarkSlateBlue"></asp:Label><br />
<asp:Label ID="urlsLabel" runat="server" Text='<%#
Eval("urls") %>' ForeColor="DarkSeaGreen"></asp:Label><br />
<asp:HiddenField ID="page" runat="server" Value='<%#
Eval("page_ref") %>'></asp:HiddenField><br />
<br />
</ItemTemplate>
</aspataList>
and i want to access the value of hiddenfield in my aspx.cs file for
some manipulation.for this purpose i'm using the following code:
for(i=0;i<DataList1.items.count;i++)
{
HiddenField hd = (HiddenField)DataList1.Items[2].FindControl("page");
string s = (hd.Value) as string;
}
its giving me the whole record of datalist.but i want to get only the
selected item against my record.
any one have idea about it,plz rply me.