Don't Understand error

W

Wayne Wengert

I am using a Gridview in an ASP.NET 2.0 (VB) application. In a hyperlink
template column I want to build a url wich includes passing a couple of
query strings that I need to populate dynamically.

When that code is as shown here - it works fine:
======================
NavigateUrl=
<%#"javascript:javascript:eek:penWindow('ViewNominationText.aspx?id=4', 600,
400 ,0 ,0 ,0 ,0 ,0 ,1 ,10 ,10 );" %>

text="View">

======================

When I change the code to:
======================
NavigateUrl=
<%#"javascript:javascript:eek:penWindow('ViewNominationText.aspx?id=" +
DataBinder.Eval(Container.DataItem, "id")', 600, 400 ,0 ,0 ,0 ,0 ,0 ,1 ,10
,10 );" %>

text="View">

==============================

VWD 2005 flags the line with the error "')' expected" ?



Something about the DataBinderEval process seems to be triggering the error
and I cannot see the problem. Any thoughts will be much appreciated!



Wayne
 
C

cbDevelopment

You are replacing the ID with a dynamic value. Your string is not
properly formatted:

You have (only relevant part):

xt.aspx?id=" + DataBinder.Eval(Container.DataItem, "id")', 600,

It should be:

xt.aspx?id=" + DataBinder.Eval(Container.DataItem, "id") + "', 600,

Notice the + " after the databinder.eval statement.

----
700cb Development, Inc.
http://www.700cb.net
..NET utilities, developer tools,
and enterprise solutions

I am using a Gridview in an ASP.NET 2.0 (VB) application. In a
hyperlink template column I want to build a url wich includes passing
a couple of query strings that I need to populate dynamically.

When that code is as shown here - it works fine:
======================
NavigateUrl=
<%#"javascript:javascript:eek:penWindow('ViewNominationText.aspx?id=4',
600, 400 ,0 ,0 ,0 ,0 ,0 ,1 ,10 ,10 );" %>

text="View">

======================

When I change the code to:
======================
NavigateUrl=
<%#"javascript:javascript:eek:penWindow('ViewNominationText.aspx?id=" +
DataBinder.Eval(Container.DataItem, "id")', 600, 400 ,0 ,0 ,0 ,0 ,0 ,1
,10 ,10 );" %>

text="View">

==============================

VWD 2005 flags the line with the error "')' expected" ?



Something about the DataBinderEval process seems to be triggering the
error and I cannot see the problem. Any thoughts will be much
appreciated!



Wayne



--
 
W

Wayne Wengert

Thanks

Wayne

cbDevelopment said:
You are replacing the ID with a dynamic value. Your string is not
properly formatted:

You have (only relevant part):

xt.aspx?id=" + DataBinder.Eval(Container.DataItem, "id")', 600,

It should be:

xt.aspx?id=" + DataBinder.Eval(Container.DataItem, "id") + "', 600,

Notice the + " after the databinder.eval statement.

----
700cb Development, Inc.
http://www.700cb.net
.NET utilities, developer tools,
and enterprise solutions





--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top