Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Stupid ASP Question

0 views
Skip to first unread message

Earl Damron

unread,
Oct 29, 2002, 9:45:32 PM10/29/02
to
At least I feel stupid anyway.

I have a template column in a DataGrid that I want to be a hyperlink.

When I build the NavigateUrl portion of the asp:HyperLink element, I have
this:

NavigateUrl='<%# DataBinder.Eval(Container, "DataItem.DemoNumber",
"Patient.aspx?DemoNbr={0}") %>'>

My link turns out great at run-time and looks like:

NavigateUrl=Patient.aspx?DemoNbr=12345

My question is, can't the NavigateUrl be built in two parts? Something like

NavigateUrl='<%# DataBinder.Eval(Container, "DataItem.DemoNumber",
"Patient.aspx?DemoNbr={0}") %>
<%# DataBinder.Eval(Container, "DataItem.ChartNumber", "&ChartNbr={0}") %>'>

(both of the above lines are together in the actual code)

The goal would be for the link to look like

NavigateUrl=Patient.aspx?DemoNbr=12345&ChartNbr=54321

Every time I run it this way, I get:

Overload resolution failed because no accessible 'ToString' accepts this
number of arguments

If you can, please bail this idiot out before it gets any later!

Thanks


Earl Damron

unread,
Oct 29, 2002, 10:07:32 PM10/29/02
to
I guess I occasionally get lucky after all.

I needed to change my ASP code to look like:

NavigateUrl='<%# DataBinder.Eval(Container, "DataItem.DemoNumber",

"Patient.aspx?DemoNbr={0}") + DataBinder.Eval(Container,


"DataItem.ChartNumber", "&ChartNbr={0}") %>'>

"Earl Damron" <earld...@mail.com> wrote in message
news:eTUX747fCHA.1960@tkmsftngp12...

martin

unread,
Oct 30, 2002, 9:47:51 AM10/30/02
to

In your code behind creat a sub procedure called
sub createLink ( e1 as object ...)

i our aspx page put in the column <%# createlink(dataite
("xx"),....) %> etc

and in the sub procedure build your output link

return "xxx.aspx?d=" & e1.tostring ....

Does this make sense? it works for me!

>.
>

0 new messages