Hyperlink text issue-----need help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • sara10
    New Member
    • Feb 2010
    • 3

    Hyperlink text issue-----need help

    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

    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";
        }
    .aspx file

    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>
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Please do not double post your question.
    This divides our attempts to help you, making it harder for us to give you an answer (because we can't see what others have already recommended to you) and it makes it difficult for you to get an answer (because you have more than one place to look for any possible answers).

    I've closed this thread. Please refer to your other thread regarding this issue for more help. It can be found here: DataList inside TabContainer doesn't Show links

    -Moderator Frinny

    Comment

    Working...