Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

easy one for experts

Status
Not open for further replies.

hmckillop

Programmer
Oct 30, 2001
1,540
GB
I have a function on my BasePage called GetEncodedURL(), which takes a URL(string) and a string[] of args, and returns a URL Encoded String.

In one of my APSX pages I have two asp:Hyperlink controls.
The first one is within a gridview, with the NavigateURL property set to:

'<%# GetEncodedUrl(Resources.Links.ViewAccountDetails, "accountID", Convert.ToString(Eval("AccountOID"))) %>'

This works fine. The GetEncodedURL function gets called, and the link works as expected.


The problem happens when I try to do something similar with the second asp:hyperlink control. From what I can see, the only difference is that this one is NOT within a gridview. It's NavigateURL property looks like this:

'<%# GetEncodedUrl(Resources.Links.AddKeyAccounts, "AccountType", Enum.InternationalAccount.ToString())%>'


The function doesn't get called, and the link just renders as plain text.

Any idea why the function isn't being called with the second example?
 
If the second control isn't within a GridView, have you tried setting the NavigateURL directly from the code behind on the Page Load event? At least this way it will make it easier to debug.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Hi,

Thanks for the reply.
Yes, I can set it from the code-behind, I was hoping I could get the above example working though. Curious as to why it won't!

Thanks again.

"I'm living so far beyond my income that we may almost be said to be living apart
 
I'm not sure either as it seems to work in a simple test I've done, however, I try never to have any functionality in the aspx and keep this seperated into the code-behind page (it makes it easier to debug and cleaner to read).


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top