Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 26th, 2004, 12:06 AM
Authorized User
 
Join Date: Jul 2004
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default hyperlink problem

Ive a problem that ,when i fatch a datatable from the data base,then
the fached records became hyperlink.
Same as p2p.wrox.com,in which when we select a perticular topic,
then we can see the reply as well as can also see the detail of a author,by navigate through hyperlink.
There is a option in datagrid control to make a column's field Hyperlink,but i'm unable to do that.
so what's way to do ,or is there any other mathod?

abhinavjain
__________________
abhinavjain
 
Old August 26th, 2004, 12:45 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 326
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Santhi Send a message via MSN to Santhi
Default

Have you used TemplateColumn to create the Hyperlink in the datagrid.Did you set the AutoGenerateColumns property of the datagrid to false?
This is the way you can create hyperlink in Datagrid
<Columns>
<asp:TemplateColumn>
   <ItemTemplate>
    <asp:HyperLink Runat="server" ID="summary" text=<% #DataBinder.Eval(Container.DataItem,"summary")%>>
        <%#DataBinder.Eval(Container.DataItem,"summary") %>
    </asp:HyperLink>
   </ItemTemplate>
</asp:TemplateColumn>
</Columns>
If you have done like this ,it should work fine..

 
Old August 27th, 2004, 03:56 AM
Authorized User
 
Join Date: Jul 2004
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi santhi,
Now it is wroking,ive write following code
<asp:TemplateColumn HeaderText="Topic">
<ItemTemplate>
<asp:Hyperlink ID="Hyperlink2"
NavigateUrl='<%#"Reply.aspx?Topic=" & DataBinder.Eval(Container.DataItem, "Topic")%>'
Text='<%#DataBinder.Eval(Container.DataItem, "Topic")%>' runat="server">
</asp:Hyperlink>
</ItemTemplate>
</asp:TemplateColumn>
Now my problem is that,as here "Topic is passed,can i passed the correspondence ID also.
ie i want to use both "Topic" as well as "ID" at Reply.aspx.


abhinavjain
 
Old August 27th, 2004, 07:54 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 326
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Santhi Send a message via MSN to Santhi
Default

That is Cool.
If you want to pass the ID in the querystring append ID also in the navigateURL.
(ex).NavigateUrl='<%#"Reply.aspx?Topic=" & DataBinder.Eval(Container.DataItem, "Topic")&",ID="&DataBinder.Eval(Container.DataItem , "TopicID")%>'

Note:Your select query should include Id also.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Hyperlink JaffAJob Word VBA 3 August 28th, 2007 11:50 AM
hyperlink problem hastikeyvan Classic ASP Professional 5 January 22nd, 2007 07:03 PM
HyperLink Problem monika.vasvani ASP.NET 1.0 and 1.1 Professional 2 September 30th, 2006 05:17 AM
Hyperlink Problem Lalit Pradhan ASP.NET 2.0 Professional 2 June 14th, 2006 09:36 AM
hyperlink problem Abhinav_jain_mca SQL Server 2000 1 August 25th, 2004 01:43 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.