PC Review


Reply
Thread Tools Rate Thread

Databinding: How do I use the data as a parameter for a method or function?

 
 
Nathan Sokalski
Guest
Posts: n/a
 
      13th Jun 2005
I am using a SortedList as my DataSource. However, one of the things I am
using the data for is to generate the URL for the HyperLinks in my DataList.
Therefore, I need to use the result of a Server.UrlEncode() method with the
data as the parameter. The code I am using to get the data from the
SortedList (which successfully gives me the expected value) is:

<%# DataBinder.Eval(Container, "DataItem.Key") %>

However, when I try to modify this to be used as the parameter for the
Server.UrlEncode() (or any other method and/or function), I recieve an
error. Is there a way to do what I want and still use the DataList? Thanks.
--
Nathan Sokalski
(E-Mail Removed)
http://www.nathansokalski.com/


 
Reply With Quote
 
 
 
 
Hemang Shah
Guest
Posts: n/a
 
      13th Jun 2005
What is the error you are getting ?

Try adding .ToString(); at the end of the function.

Most likely the url encode expects a string value.

"Nathan Sokalski" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I am using a SortedList as my DataSource. However, one of the things I am
>using the data for is to generate the URL for the HyperLinks in my
>DataList. Therefore, I need to use the result of a Server.UrlEncode()
>method with the data as the parameter. The code I am using to get the data
>from the SortedList (which successfully gives me the expected value) is:
>
> <%# DataBinder.Eval(Container, "DataItem.Key") %>
>
> However, when I try to modify this to be used as the parameter for the
> Server.UrlEncode() (or any other method and/or function), I recieve an
> error. Is there a way to do what I want and still use the DataList?
> Thanks.
> --
> Nathan Sokalski
> (E-Mail Removed)
> http://www.nathansokalski.com/
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 Data -- SQL Server proc or function with parameter lm Microsoft Excel Misc 0 20th May 2009 01:01 AM
Passing method reference in a method parameter =?Utf-8?B?TGVvTmljb2xhcw==?= Microsoft C# .NET 1 15th Jun 2005 01:59 PM
Databinding: How do I use the data as a parameter for a method or function? Nathan Sokalski Microsoft ASP .NET 2 13th Jun 2005 04:36 AM
Can i pass a SqlConnection object with opened connection to a method/function as a parameter? Parco Microsoft Dot NET Framework 13 3rd Oct 2004 09:14 PM
Using Method.Invoke on a method that accepts an array parameter... nfedin Microsoft Dot NET Framework 4 23rd Apr 2004 07:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:06 PM.