• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Datalists, Querystring and VB.NET 2.0

SoundTheSurrender

Diamond Member
EDIT:

I figured it out but it doesn't work fully. It works in IE7 but not Firefox so I'm guessing Safari won't work either.

I used the PostBackURL binding and I did..

../Products/Default.aspx?tID={0}

What am I doing wrong?


EDIT2:

I figured it out, I used Bind instead of Eval. I guess that did the trick.



Hello,

I have a datalist that shows off different products. I have a imagebutton and title.

The purpose of the imagebutton is to go into a details page for each product.

I can't seem to figure out how to get the imagebutton to do a querystring.

For example, if I do in the html bar,

tshirt/Products/Default.aspx?tID=1

tshirt/Products/Default.aspx?tID=2

tshirt/Products/Default.aspx?tID=3

The individual product shows up.

I have no idea how to get the imagebutton to do a querystring. When I try to make a variable label that holds the tID, I can get it to display but if I try to make VB.NET code with it, it will claim it doesn't exist.

For example I tried

Response.Redirect("tshirt/Products/Default.aspx?tID" & lblID.Text)

lblID.Text does not exist.

Do I use the OnClientClick?

Thanks
 
Are you using the declarative mode in your Visual Studio IDE? If so, try something like this in your .aspx file:

<asp:repeater id="testReapeater" runat="server">
<itemtemplate>
<asp:HyperLink runat="server" NavigateUrl='~/tshirt/Products/Default.aspx?tID=<%# Eval("tID") %>' Text='<%# Eval("tName") %>'/>
</itemtemplate>
</asp:repeater>

Notice that you'll need columns called tID and tName in your DataSource.

You should not be using "Bind," unless your intent is to allow the user to edit the contents of your DataContainer (DataList, GridViee, etc.).
 
Back
Top