This is a migrated thread and some comments may be shown as answers.

Open RW from hyperlink (inside FormView)?

4 Answers 78 Views
Window
This is a migrated thread and some comments may be shown as answers.
Kenny
Top achievements
Rank 1
Kenny asked on 20 Mar 2009, 05:26 PM
Hi all,
How do I open a radWindow from a hyperlink that resides inside a formview. I need to pass some ID to the querystring, this is what my current FormView looks like:

<asp:FormView ID="FormViewLatestBlog" runat="server" Width="100%" OnDataBound="FormViewLatestBlog_DataBound"
    <ItemTemplate> 
        <div class="post"
            <h1 class="title"
                <a href="#"
                    <asp:Label ID="LabelTitle" runat="server" Text='<%#Bind("BLOG_TITLE") %>'></asp:Label></a></h1> 
            <div class="entry"
                <asp:Label ID="LabelContent" runat="server" Text='<%#Bind("BLOG_CONTENT") %>'></asp:Label> 
            </div> 
            <p class="meta"
                Posted by <a href="#"
                    <asp:Label ID="LabelAddedBy" runat="server" Text='<%#Bind("BLOG_ADDED_USERNAME") %>'></asp:Label></a> 
                (<asp:HyperLink ID="HyperLinkEditBlog" runat="server" CssClass="comments" NavigateUrl='<%# String.Format("~/Admin/Blogs.aspx?Edit=True&BlogID={0}", Eval("BLOG_ID")) %>' 
                    Visible="false">Edit</asp:HyperLink>) on 
                <asp:Label ID="LabelAddedDate" runat="server" Text='<%#Bind("BLOG_ADDED_DATE") %>'></asp:Label>&nbsp;&bull;&nbsp; 
                <asp:HyperLink ID="HyperLinkComment" runat="server" CssClass="comments" NavigateUrl='<%# String.Format("/Blog/Comment.aspx?BlogID={0}", Eval("BLOG_ID")) %>'>Leave A Comment</asp:HyperLink> 
                (<asp:Label ID="LabelCommentCount" runat="server" Text='<%#Bind("BLOG_COMMENT_COUNT") %>'></asp:Label>)&nbsp;&bull;&nbsp; 
                <asp:HyperLink ID="HyperLinkReadFullArticle" runat="server" CssClass="comments" NavigateUrl='<%# String.Format("~/Blog/Default.aspx?BlogID={0}", Eval("BLOG_ID")) %>'>Read full article</asp:HyperLink></p> 
        </div> 
    </ItemTemplate> 
</asp:FormView> 

Now I want to make the "HyperLinkComment" to open a radWindow instead of going to that page, what should I do?
Thank you very much.

4 Answers, 1 is accepted

Sort by
0
Kenny
Top achievements
Rank 1
answered on 20 Mar 2009, 09:14 PM
I've changed the HyperLink to use regular HTML hyperlink and followed the example in the help file and it works fine now.

Thanks.
0
Jay
Top achievements
Rank 1
answered on 25 Aug 2011, 10:47 PM
That works great for passing single values from FormView, is there an easy way to alter this code to allow up to 5 or 6 values to be sent with the same hyperlink?

Thanks
0
Marin Bratanov
Telerik team
answered on 26 Aug 2011, 01:05 PM
Hello Jay,

Simply use more parameters in the querystring, the String.Format() method allows you to use more than one placeholder, i.e. you can go with {0}, {1}, {2} and so on, as many as you need, for example:
String.Format("/Blog/Comment.aspx?BlogID={0}&UserID={1}", Eval("BLOG_ID"), Eval("USER_ID"))

You can also examine the following google search on the matter: http://www.google.com/search?q=multiple+querystring+parameters.

Best wishes,
Marin
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Jay
Top achievements
Rank 1
answered on 26 Aug 2011, 02:06 PM
Perfect! That's exactly what I was looking for!

Thank You very much for your help! Much appreciated!

Jay
Tags
Window
Asked by
Kenny
Top achievements
Rank 1
Answers by
Kenny
Top achievements
Rank 1
Jay
Top achievements
Rank 1
Marin Bratanov
Telerik team
Share this question
or