> I am finally getting the path to the Current Page using Page.ResolveURL.
>
[quoted text clipped - 19 lines]
>
> Tom
> Tom,
> Use <%# ... %> instead of <%= %>
I tried that here:
<asp:Hyperlink ID="test2" Text="HyperLink Test with ResolveURL"
NavigateUrl='<%# Page.ResolveUrl("displayCompanyOverview.aspx") %>'
runat="server"/>
But I am getting just plane text and it is not a link.
Am I missing something?
Thanks,
Tom
> cheers,
> Vince
[quoted text clipped - 22 lines]
>>
>> Tom
tshad - 02 Aug 2007 02:53 GMT
I can set the NavigateURL for my Hyperlinks programmatically. For example,
I can do the following in the Page_Load event and it works fine:
test3.NavigateURL = Page.ResolveUrl("displayCompanyOverview.aspx")
This sets it fine.
But then for all my pages I will have to either set this for all the
Hyperlinks and HyperlinkColumns in my DataGrid. The former would have to be
set in Page_Load event and the later (datagrids) would have to be set in the
PreRender event (I think). What I was hoping to do was do it in the tag
itself.
Thanks,
Tom
>> Tom,
>> Use <%# ... %> instead of <%= %>
[quoted text clipped - 40 lines]
>>>
>>> Tom
teemu.keiski@gmail.com - 02 Aug 2007 12:43 GMT
Did you realize you need to call DataBind() for thge Page or the
control in question for databinding expressions <%# %> to be
evaluated?
Teemu
> <vincent.ap...@gmail.com> wrote in message
>
[quoted text clipped - 45 lines]
>
> - N?yt? siteerattu teksti -
tshad - 02 Aug 2007 16:04 GMT
Did you realize you need to call DataBind() for thge Page or the
control in question for databinding expressions <%# %> to be
evaluated?
I was pretty sure of that and that was why I also tried <%= and <% neither
of which worked.
Is it possible you can't do this particular function inline?
Thanks,
Tom
Teemu
On 2 elo, 04:27, "tshad" <t...@home.com> wrote:
> <vincent.ap...@gmail.com> wrote in message
>
[quoted text clipped - 49 lines]
>
> - Näytä siteerattu teksti -
tshad - 03 Aug 2007 01:39 GMT
I assume this can't be done.
I was told by some else:
"What you'll need to do then is to use the '<%# %>' data-binding expression
instead, and call Page.DataBind from the code-behind. But if you don't have
code-behind, then I don't believe you can accomplish what you want."
Since I am not using code-behind I assume this can't be done. I have tried
all kinds of combinations and can't get it to work, so I give up as it is
causing too much time.
Thanks,
Tom
> Did you realize you need to call DataBind() for thge Page or the
> control in question for databinding expressions <%# %> to be
[quoted text clipped - 65 lines]
>>
>> - Näytä siteerattu teksti -
tshad - 03 Aug 2007 16:07 GMT
I decided to try one more time to use the HyperLink in my Datagrid using <%#
%> and eval and unlike a Hyperlink which outside of the datagrid gives me
nothing, this does resolve the path but doesn't do it the same as when you
do it programmatically.
If I do:
dim test as String
test = Page.ResolveUrl("displayCompanyOverview.aspx")
test3.NavigateURL = Page.ResolveUrl("displayCompanyOverview.aspx")
This works fine and gives you the URL:
/jobseeker/displayCompanyOverview.aspx (the Current Page Path)
If I do:
<asp:HyperLinkColumn ItemStyle-Width="190" DataTextField="JobTitle"
DataTextFormatString="{0}" DataNavigateUrlField="PositionID"
DataNavigateUrlFormatString='<%#
Page.ResolveURL("displayPositionNS.aspx?PositionID=" + eval("{0}"))'
This gives me:
/applicant/displayPositionNS.aspx?PositionID=210 (The Controls Path
I have no idea why this is working this way. It makes no sense to me.
It doesn't appear to be using the ResolveURL at all. If it did, it would
resolve to the same path as when it was done programatically.
Tom
>I assume this can't be done.
>
[quoted text clipped - 82 lines]
>>>
>>> - Näytä siteerattu teksti -