NavigateURL correct syntax, please, for a Hyperlink stored in a repeater.

  • Thread starter msnews.microsoft.com
  • Start date
M

msnews.microsoft.com

Hi

I have the following problem - I need to show some binary files stored in a
db.

I use a repeater, with the following HTML:

------------------------------------------------------------------------------------------------------------------
<asp:Repeater id="Repeater1" runat="server">
<ItemTemplate>
<asp:HyperLink
ID="HyperLink1"
Text='<%# container.dataitem("Title") %>'
NavigateUrl= String.Format("ShowDBUpload.aspx?ID={0}", '<%#
container.dataitem("Title") %>')
Runat="server">
</asp:HyperLink>
<asp:Label ID="lblType" text = '<%# container.dataitem("Type") %>'
Runat=server></asp:Label>
<hr>
</ItemTemplate>
</asp:Repeater>
------------------------------------------------------------------------------------------------------------------

What I need to do here is this: I have a form named ShowDBUpload.aspx and I
want the Hyperlink contained in my repeater to have as caption the name of
the file (that's done) and to navigate to ShowDBUpload.aspx while passing as
ID the name of my file (retrieved from the database from the field 'Title').

Well, the navigation portion "leaves to be desired", since I have as error
"The server tag is not well formed."

So what is the right syntax to use in order to correctly specify the
"NavigateURL" value ? I tried in a few ways, but....

Thanks a lot for helping me.
Alex.
 
A

anon

Try using the properties DataNavigateUrlFormatString and
DataNavigateUrlField should work just fine then...

D
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top