views:

75

answers:

1

Hi ,

I have a repeater and it looks like this

heading1

A B C D

=====

Heading2

E F G H

both of these two are interconnected and when I am clicking on Heading1 or heading2 it is creating a combine query string for. e.g.

when i click on A Querystring: default.aspx?Heading1=A When I click on B QueryString: default.aspx?Heading1=A&Heading1=B When I click on E QueryString: default.aspx?Heading1=A&Heading1=B&Heading2=E

The thing is values in Heading1 and heading2 are dynamic any idea how to acheive this?

Thanks,

A: 

Use the OnItemDataBound event handler and make the link an ASP.NET Hyperlink component, that way you can then get the values you wish to put into the query string from the Item.DataItem parameter and simply append then to the Link.NavigateUrl property. e.g.

protected void Repeater1_ItemDataBound(Sender As Object, e As RepeaterItemEventArgs)
{
    ((HyperLink) e.Item.FindControl("HyperLink1")).NavigateUrl += "?Heading1=" + (([cast type]) e.Item.DataItem).item1...;
{
philjohn