Thursday, March 22, 2012

Setting the navigate URL

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!Check out the stringbuilder function...

Dave
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
"Arjen" wrote:

> 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!
>
Also, I'm not completly sure if you can set server controls like that...

Jason Lind

"Arjen" wrote:

> 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!
>
This is not posible. ;-(
Ha, I get it done by this:
NavigateUrl='<%# "~/test2.aspx?ID=" + DataBinder.Eval(Container.DataItem,
"Id") %>'

Thanks,
Arjen

"Jason L Lind" <JasonLLind@.discussions.microsoft.com> schreef in bericht
news:0287636E-C7C2-40CA-A773-AF70838E7F38@.microsoft.com...
> Also, I'm not completly sure if you can set server controls like that...
> Jason Lind
> "Arjen" wrote:
>> 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!
>>
>>
>

0 comments:

Post a Comment