Reputation: 219
I have a repeater control which displays id's.
<repeater id="a" runat ="server">
<ItemTemplate>
<asp:LinkButton ID="bt1" runat="server" PostBackUrl= '<%# "~/Default.aspx"?id=" + Container.DataItem.ToString() %>' /asp:LinkButton>
</ItemTemplate>
</asp:Repeater>
In my default page I am able to access it like this.
Dim foo as String = Request.QueryString("id")
My question- How would I post the data. By post I mean not using query string because I don't want the id to show up in the url? Any help would be appreciated!
Upvotes: 0
Views: 976
Reputation: 56
You are close. Postbackurl is infrequently used in asp.net. If you need to post data to a different page, it's useful, but not for simple postbacks.
When you are within a data binding control like a repeater, use the "commandargument" property of the linkbutton. You can then trap the value in the repeater's itemcommand event in the codebehind.
Here is an example:
Good luck!
Upvotes: 1