Link to home
Start Free TrialLog in
Avatar of Steven O'Neill
Steven O'NeillFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Add parameters to LinkButton

Might not even be doing this correctly so I'll explain what I'm trying to do. Very simply I'm trying to create a GridView and within this I will have a button. This button will have some additional parameters added to it (namely an ID) so I would suspect it would look something like #/volunteer.aspx?ID=000000 (with the actual ID added to the end of the link)

So I have my code like this:
<asp:TemplateField>
                                    <ItemTemplate>
                                        <asp:LinkButton runat="server" ID="NewViewReports" CommandName="ViewReports" CommandArgument='<%# Eval("CRM_BusinessGUID", "~/Volunteer.aspx?ID={0}") %>' CssClass="btn btn-primary btn-large" Text="New View Reports &raquo;" />
                                    </ItemTemplate>
                                </asp:TemplateField

Open in new window

and although the button is created correctly the links are not there but the HTML looks like this:
<a class="btn btn-primary btn-large" id="MainContent_ctl00_GridView1_NewViewReports_0" href="javascript:__doPostBack('ctl00$MainContent$ctl00$GridView1$ctl02$NewViewReports','')">New View Reports »</a>

Open in new window

Hopefully this is an easy one to sort and I've explained what I'm after so appreciate any advice you guys can offer.

Thanx again
ASKER CERTIFIED SOLUTION
Avatar of Hiran Desai
Hiran Desai
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Steven O'Neill

ASKER

Ok being very thick here lol...that's sorted my issue but should've known that one.

Ended up using the NavigateUrl method

Thanx again