Hi,
I have a datalist.what i want to do is to show my data from database as hyperlinks, and when i click on any of that link it redirects to other page. In that directed page i am getting the link text by "querystrin g". Every thing is working fine but the problem is that when i put the same datalist inside a tab container the "querystrin g" returns Null.
can any one help please how can i get the hyperlink text??
here is the code.
.cs file
.aspx file
I have a datalist.what i want to do is to show my data from database as hyperlinks, and when i click on any of that link it redirects to other page. In that directed page i am getting the link text by "querystrin g". Every thing is working fine but the problem is that when i put the same datalist inside a tab container the "querystrin g" returns Null.
can any one help please how can i get the hyperlink text??
here is the code.
.cs file
Code:
da.SelectCommand.CommandText= strQuery;
DataSet myds = new DataSet();
da.Fill(myds);
DataList1.DataSource = myds;
DataList1.DataBind();
protected void databound(object sender, DataListItemEventArgs e)
{
HyperLink hpclk = (HyperLink)(e.Item.FindControl("hlpnews"));
hpclk.NavigateUrl = "~/NewFolder1/main.aspx";
}
Code:
<cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0"
Width="409px" Height="237px">
<cc1:TabPanel runat="server" HeaderText="TabPanel1" ID="TabPanel1">
<HeaderTemplate>
A
</HeaderTemplate>
<ContentTemplate>
<asp:DataList ID="DataList1" runat="server"
Font-Size="Medium" repeatColumns="2" OnItemDataBound ="databound" Height="105px"><ItemTemplate><asp:HyperLink runat ="server" OnLoad="link" ID="hlpnews" text='<%#DataBinder.Eval(Container.DataItem,"Medicine") %>'> </asp:HyperLink></ItemTemplate>
</asp:DataList>
</ContentTemplate>
</cc1:TabPanel>
</cc1:TabContainer>
Comment