Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi...Can anyone tell me whats wroing with this part of the code???

 

<asp:HyperLink Runat="server"

Text='<%#DataBinder.Eval(Container.DataItem,"name")%>'

NavigateUrl='Profile.aspx?id=<%#DataBinder.Eval (Container.DataItem,"idNum")%>'>

</asp:HyperLink>

 

the first part, i.e. the column text is showing correctly but the id of the profile in the second set of the asp tags is not coming??? whatever is in the

 

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

 

is showing as a string in the link along with the asp tags!!!

 

 

Thanks,

SJ

Posted
You can either try having the Eval format the whole URL or try to not use the DataBinder.Eval at all since this string doesnt need any real type of formatting. I try to use DataBinder sparingly since it is late binding, unless i really need to do some formatting.
  • *Experts*
Posted

I don't know if this will make a difference at all, but there is a

space after the "Eval" in the second code block, so it should be:

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

 

Also make sure that you have the correct column name and

capitalization for idNum.

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...