Open RW from hyperlink (inside FormView)?

5 posts, 0 answers
  1. Kenny
    Kenny avatar
    40 posts
    Member since:
    May 2008

    Posted 20 Mar 2009 Link to this post

    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.
  2. Kenny
    Kenny avatar
    40 posts
    Member since:
    May 2008

    Posted 20 Mar 2009 Link to this post

    I've changed the HyperLink to use regular HTML hyperlink and followed the example in the help file and it works fine now.

    Thanks.
  3. Jay
    Jay avatar
    2 posts
    Member since:
    Aug 2011

    Posted 25 Aug 2011 Link to this post

    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
  4. Marin Bratanov
    Admin
    Marin Bratanov avatar
    4570 posts

    Posted 26 Aug 2011 Link to this post

    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 >>

  5. Jay
    Jay avatar
    2 posts
    Member since:
    Aug 2011

    Posted 26 Aug 2011 Link to this post

    Perfect! That's exactly what I was looking for!

    Thank You very much for your help! Much appreciated!

    Jay
Back to Top