Setting the navigate URL

A

Arjen

Hi,

How can I set the navigate URL with parameter without extra code?

I have now this:
NavigateUrl="~/test2.aspx?ID=" + <%# Bind("Id") %>

There must be a way to do this with a string function....

Thanks for help!
 
G

Guest

Generally the proper way of setting things like that is in the code behind.

However, if for whatever reason you want to do it this way, it would look
more like:
NavigateUrl="~/test2.aspx?ID=<%# Bind("Id") %>" inside the element that your
are setting that attribute on.

Jason Lind
 
G

Guest

Also, I'm not completly sure if you can set server controls like that...

Jason Lind
 
A

Arjen

Ha, I get it done by this:
NavigateUrl='<%# "~/test2.aspx?ID=" + DataBinder.Eval(Container.DataItem,
"Id") %>'

Thanks,
Arjen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top