Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Sep 20, 2007 09:20 PM by figgie
Member
35 Points
90 Posts
Sep 19, 2007 11:07 AM|LINK
Hi,
I wish to change the following line of code in the SmallBusiness starter kit's items.aspx file.
NavigateUrl='<%# "ItemDetail.aspx?itemId=" + (string)Eval("Id") %>'>
to something like...
NavigateUrl='<%# http://www.mysite.com/files/" + (string)Eval("Id") %>'>
but i don't know how to correctly format the string!.
I want the link to be a URL to my web site & the last portion of the file name to be created by the "Id" tag.
e.g. http://www.mysite.com/files/fileid1.zip
Thanks
Paul.
Star
12439 Points
2153 Posts
Sep 19, 2007 11:24 AM|LINK
You are missing the starting quote. Have a look at the original line and compare it to yours to see the format that it needs to be in.
Website Design Darlington - http://lessthandot.com - http://aspnetlibrary.com
34 Points
24 Posts
Sep 20, 2007 09:20 PM|LINK
Ok
instead of using a hard coded URL like you want to
I would instead use a logical path name
NavigateUrl='<%# "../files/" + (string)Eval("Id") %>'>
This is helpful incase the website name ever changes. You don't have to muck through code looking for all the hardcoded paths. Bad practice to use hardcoded path.
pr_wainwrigh...
Member
35 Points
90 Posts
Change item detail NavigateURL
Sep 19, 2007 11:07 AM|LINK
Hi,
I wish to change the following line of code in the SmallBusiness starter kit's items.aspx file.
NavigateUrl='<%# "ItemDetail.aspx?itemId=" + (string)Eval("Id") %>'>
to something like...
NavigateUrl='<%# http://www.mysite.com/files/" + (string)Eval("Id") %>'>
but i don't know how to correctly format the string!.
I want the link to be a URL to my web site & the last portion of the file name to be created by the "Id" tag.
e.g. http://www.mysite.com/files/fileid1.zip
Thanks
Paul.
ca8msm
Star
12439 Points
2153 Posts
Re: Change item detail NavigateURL
Sep 19, 2007 11:24 AM|LINK
You are missing the starting quote. Have a look at the original line and compare it to yours to see the format that it needs to be in.
Website Design Darlington - http://lessthandot.com -
http://aspnetlibrary.com
figgie
Member
34 Points
24 Posts
Re: Change item detail NavigateURL
Sep 20, 2007 09:20 PM|LINK
Ok
instead of using a hard coded URL like you want to
NavigateUrl='<%# http://www.mysite.com/files/" + (string)Eval("Id") %>'>
I would instead use a logical path name
NavigateUrl='<%# "../files/" + (string)Eval("Id") %>'>
This is helpful incase the website name ever changes. You don't have to muck through code looking for all the hardcoded paths. Bad practice to use hardcoded path.