DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Wed, 1 Aug 2007 16:00:41 -0700,    posted on: microsoft.public.dotnet.framework.aspnet        back       

Thread Index
  1    tshad
          2    unknown
          3    tshad
          4    tshad
          5    unknown
          6    tshad
          7    tshad
          8    tshad


Hyperlink and ResolveURL   
I am finally getting the path to the Current Page using Page.ResolveURL.

I am now getting "/jobSeeker/displayCompanyOverview.aspx" which is what I
was looking for.

But what is the syntax to add it into the HyperLink object?

I tried:

<asp:Hyperlink ID="test2" Text="HyperLink Test with ResolveURL"
NavigateUrl='<%= Page.ResolveUrl("displayCompanyOverview.aspx") %>'
runat="server"/><br>

and this gives me:

http://www.stw.com/applicant/<%=%20Page.ResolveUrl("displayCompanyOverview.aspx")%20%>

I also tried <% %> and had the same problem?  Do I need sometype of Eval
syntax?

Thanks,

Tom
Date:Wed, 1 Aug 2007 16:00:41 -0700   Author:  

Re: Hyperlink and ResolveURL   
Tom,
  Use   <%# ... %>  instead of <%= %>

cheers,
Vince

On Aug 1, 7:00 pm, "tshad"  wrote:

> I am finally getting the path to the Current Page using Page.ResolveURL.
>
> I am now getting "/jobSeeker/displayCompanyOverview.aspx" which is what I
> was looking for.
>
> But what is the syntax to add it into the HyperLink object?
>
> I tried:
>
> <asp:Hyperlink ID="test2" Text="HyperLink Test with ResolveURL"
> NavigateUrl='<%= Page.ResolveUrl("displayCompanyOverview.aspx") %>'
> runat="server"/><br>
>
> and this gives me:
>
> http://www.stw.com/applicant/<%=%20Page.ResolveUrl("displayCompanyOverview.aspx")%20%>
>
> I also tried <% %> and had the same problem?  Do I need sometype of Eval
> syntax?
>
> Thanks,
>
> Tom
Date:Wed, 01 Aug 2007 16:11:34 -0700   Author:  

Re: Hyperlink and ResolveURL   
wrote in message 
news:1186009894.527021.178600@k79g2000hse.googlegroups.com...

> 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
>
> On Aug 1, 7:00 pm, "tshad"  wrote:
>> I am finally getting the path to the Current Page using Page.ResolveURL.
>>
>> I am now getting "/jobSeeker/displayCompanyOverview.aspx" which is what I
>> was looking for.
>>
>> But what is the syntax to add it into the HyperLink object?
>>
>> I tried:
>>
>> <asp:Hyperlink ID="test2" Text="HyperLink Test with ResolveURL"
>> NavigateUrl='<%= Page.ResolveUrl("displayCompanyOverview.aspx") %>'
>> runat="server"/><br>
>>
>> and this gives me:
>>
>> http://www.stw.com/applicant/<%=%20Page.ResolveUrl("displayCompanyOverview.aspx")%20%>
>>
>> I also tried <% %> and had the same problem?  Do I need sometype of Eval
>> syntax?
>>
>> Thanks,
>>
>> Tom
>
> 
Date:Wed, 1 Aug 2007 18:27:56 -0700   Author:  

Re: Hyperlink and ResolveURL   
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

"tshad"  wrote in message 
news:%23KMlRRK1HHA.5644@TK2MSFTNGP05.phx.gbl...

>  wrote in message 
> news:1186009894.527021.178600@k79g2000hse.googlegroups.com...
>> 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
>>
>> On Aug 1, 7:00 pm, "tshad"  wrote:
>>> I am finally getting the path to the Current Page using Page.ResolveURL.
>>>
>>> I am now getting "/jobSeeker/displayCompanyOverview.aspx" which is what 
>>> I
>>> was looking for.
>>>
>>> But what is the syntax to add it into the HyperLink object?
>>>
>>> I tried:
>>>
>>> <asp:Hyperlink ID="test2" Text="HyperLink Test with ResolveURL"
>>> NavigateUrl='<%= Page.ResolveUrl("displayCompanyOverview.aspx") %>'
>>> runat="server"/><br>
>>>
>>> and this gives me:
>>>
>>> http://www.stw.com/applicant/<%=%20Page.ResolveUrl("displayCompanyOverview.aspx")%20%>
>>>
>>> I also tried <% %> and had the same problem?  Do I need sometype of Eval
>>> syntax?
>>>
>>> Thanks,
>>>
>>> Tom
>>
>>
>
> 
Date:Wed, 1 Aug 2007 18:53:40 -0700   Author:  

Re: Hyperlink and ResolveURL   
Did you realize you need to call DataBind() for thge Page or the
control in question for databinding expressions <%# %> to be
evaluated?

Teemu

On 2 elo, 04:27, "tshad"  wrote:

>  wrote in message
>
> news:1186009894.527021.178600@k79g2000hse.googlegroups.com...
>
> > 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
>
> > On Aug 1, 7:00 pm, "tshad"  wrote:
> >> I am finally getting the path to the Current Page using Page.ResolveURL.
>
> >> I am now getting "/jobSeeker/displayCompanyOverview.aspx" which is what I
> >> was looking for.
>
> >> But what is the syntax to add it into the HyperLink object?
>
> >> I tried:
>
> >> <asp:Hyperlink ID="test2" Text="HyperLink Test with ResolveURL"
> >> NavigateUrl='<%= Page.ResolveUrl("displayCompanyOverview.aspx") %>'
> >> runat="server"/><br>
>
> >> and this gives me:
>
> >>http://www.stw.com/applicant/<%=%20Page.ResolveUrl("displayCompanyOverview.aspx")%20%>
>
> >> I also tried <% %> and had the same problem?  Do I need sometype of Eval
> >> syntax?
>
> >> Thanks,
>
> >> Tom- Piilota siteerattu teksti -
>
> - Näytä siteerattu teksti -
Date:Thu, 02 Aug 2007 04:43:24 -0700   Author:  

Re: Hyperlink and ResolveURL   
wrote in message 
news:1186055004.223104.68530@19g2000hsx.googlegroups.com...
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"  wrote:

>  wrote in message
>
> news:1186009894.527021.178600@k79g2000hse.googlegroups.com...
>
> > 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
>
> > On Aug 1, 7:00 pm, "tshad"  wrote:
> >> I am finally getting the path to the Current Page using 
> >> Page.ResolveURL.
>
> >> I am now getting "/jobSeeker/displayCompanyOverview.aspx" which is what 
> >> I
> >> was looking for.
>
> >> But what is the syntax to add it into the HyperLink object?
>
> >> I tried:
>
> >> <asp:Hyperlink ID="test2" Text="HyperLink Test with ResolveURL"
> >> NavigateUrl='<%= Page.ResolveUrl("displayCompanyOverview.aspx") %>'
> >> runat="server"/><br>
>
> >> and this gives me:
>
> >>http://www.stw.com/applicant/<%=%20Page.ResolveUrl("displayCompanyOverview.aspx")%20%>
>
> >> I also tried <% %> and had the same problem?  Do I need sometype of 
> >> Eval
> >> syntax?
>
> >> Thanks,
>
> >> Tom- Piilota siteerattu teksti -
>
> - Nyt siteerattu teksti -
Date:Thu, 2 Aug 2007 08:04:38 -0700   Author:  

Re: Hyperlink and ResolveURL   
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

"tshad"  wrote in message 
news:Ob%232oZR1HHA.5980@TK2MSFTNGP04.phx.gbl...

>
>  wrote in message 
> news:1186055004.223104.68530@19g2000hsx.googlegroups.com...
> 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"  wrote:
>>  wrote in message
>>
>> news:1186009894.527021.178600@k79g2000hse.googlegroups.com...
>>
>> > 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
>>
>> > On Aug 1, 7:00 pm, "tshad"  wrote:
>> >> I am finally getting the path to the Current Page using 
>> >> Page.ResolveURL.
>>
>> >> I am now getting "/jobSeeker/displayCompanyOverview.aspx" which is 
>> >> what I
>> >> was looking for.
>>
>> >> But what is the syntax to add it into the HyperLink object?
>>
>> >> I tried:
>>
>> >> <asp:Hyperlink ID="test2" Text="HyperLink Test with ResolveURL"
>> >> NavigateUrl='<%= Page.ResolveUrl("displayCompanyOverview.aspx") %>'
>> >> runat="server"/><br>
>>
>> >> and this gives me:
>>
>> >>http://www.stw.com/applicant/<%=%20Page.ResolveUrl("displayCompanyOverview.aspx")%20%>
>>
>> >> I also tried <% %> and had the same problem?  Do I need sometype of 
>> >> Eval
>> >> syntax?
>>
>> >> Thanks,
>>
>> >> Tom- Piilota siteerattu teksti -
>>
>> - Nyt siteerattu teksti -
>
>
> 
Date:Thu, 2 Aug 2007 17:39:43 -0700   Author:  

Re: Hyperlink and ResolveURL   
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

"tshad"  wrote in message 
news:%23mzg$aW1HHA.5828@TK2MSFTNGP02.phx.gbl...

>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
>
> "tshad"  wrote in message 
> news:Ob%232oZR1HHA.5980@TK2MSFTNGP04.phx.gbl...
>>
>>  wrote in message 
>> news:1186055004.223104.68530@19g2000hsx.googlegroups.com...
>> 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"  wrote:
>>>  wrote in message
>>>
>>> news:1186009894.527021.178600@k79g2000hse.googlegroups.com...
>>>
>>> > 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
>>>
>>> > On Aug 1, 7:00 pm, "tshad"  wrote:
>>> >> I am finally getting the path to the Current Page using 
>>> >> Page.ResolveURL.
>>>
>>> >> I am now getting "/jobSeeker/displayCompanyOverview.aspx" which is 
>>> >> what I
>>> >> was looking for.
>>>
>>> >> But what is the syntax to add it into the HyperLink object?
>>>
>>> >> I tried:
>>>
>>> >> <asp:Hyperlink ID="test2" Text="HyperLink Test with ResolveURL"
>>> >> NavigateUrl='<%= Page.ResolveUrl("displayCompanyOverview.aspx") %>'
>>> >> runat="server"/><br>
>>>
>>> >> and this gives me:
>>>
>>> >>http://www.stw.com/applicant/<%=%20Page.ResolveUrl("displayCompanyOverview.aspx")%20%>
>>>
>>> >> I also tried <% %> and had the same problem?  Do I need sometype of 
>>> >> Eval
>>> >> syntax?
>>>
>>> >> Thanks,
>>>
>>> >> Tom- Piilota siteerattu teksti -
>>>
>>> - Nyt siteerattu teksti -
>>
>>
>>
>
> 
Date:Fri, 3 Aug 2007 08:07:31 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us