Click here to Skip to main content
15,886,074 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, All

When I Write In HyperLink Like this
XML
<asp:HyperLink 
  ID="HyperLink3" 
  Font-Names="Tahoma" 
  Font-Size="12px" 
  Font-Bold="True"runat="server"
  NavigateUrl='<%#Eval("AcronymId","Acronym.aspx?AcronymId={0}&Email="+Request.QueryString["Email"]&DisplayName="+Request.QueryString["DisplayName"]) %>'
Text="Edit"></asp:HyperLink>


I am geeting an Error "Newline in constant"
Posted
Updated 15-Apr-11 6:57am
v2
Comments
upatel8 15-Apr-11 13:12pm    
Now It gives Error Like'string' does not contain a definition for 'format'
web works 15-Apr-11 14:05pm    
Don't you want to set the "NavigateUrl" in code behind?

try changing
NavigateUrl='<%#Eval("AcronymId","Acronym.aspx?AcronymId={0}&Email="+Request.QueryString["Email"]&DisplayName="+Request.QueryString["DisplayName"]) %>'


to

NavigateUrl='<%# string.format("Acronym.aspx?AcronymId={0}&Email={1}&DisplayName={2}", Eval("AcronymId"), Request.QueryString["Email"], Request.QueryString["Email"]) %>'


You might need to fix the syntax up a little, it is quite hard to read here!
 
Share this answer
 
It looks like issue with quotes formation.

Similar issue discussed here: http://forums.asp.net/p/1525311/3677633.aspx[^]

I could have tried to suggest you of the Eval thing but I am not sure of what exactly you are doing there... not clear of the way you are formatting string in it? Sure it is correct? Looks like you need to use String.Format...
 
Share this answer
 
Comments
upatel8 15-Apr-11 13:35pm    
no Its not working for me
Sandeep Mewara 15-Apr-11 13:45pm    
What is not working? You need to t6ake care of quotes properly.

Bluntly saying 'not working' is not going to help anyone!
Plz write all code in Double cots Like url=" ".
try to change it
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900