Compiler Error Message: CS1003: Syntax error, ':' expected

hent..." : "slett..."%>Hi, i have error in the belowed statement.

It says " CS1003: Syntax error, ':' expected"

If any body help me, It would be grateful.. Thanks in advance.  

Compiler Error Message: CS1003: Syntax error, ':' expected

Source Error:

Line 28:                                         <td style="border:1;"><%# Eval("Person")%></td>
Line 29:                                         <td style="border:1;"><%# Eval("ass")%></td>
Line 30:                                         <td style="border:1;"><%#(Convert.ToInt16(Eval("showit")) == 0) ? "<a href='?deleteid=(Convert.ToInt16(Eval("showit")))'>hent...</a>" : "<a href='?deleteid=(item.id)(filterparam)'>slett...</a>"%> 
Line 31:                                         </td>
Line 32:                                     </tr>
0
Aarowne
11/23/2007 11:44:05 AM
asp.net.web-forms 93655 articles. 3 followers. Follow

6 Replies
1697 Views

Similar Articles

[PageSpeed] 36

AFAIK, <%# %> is only available to binding methods, such as Bind and Eval. You should try with <%= %>

But, you also have an error in line 30: "<a href='?deleteid=(Convert.ToInt16(Eval("showit")))'>hent...</a>"  -> You open twice the " character


Fabian
0
fvilers
11/23/2007 12:07:23 PM

 Hi,

I'm not sure about the error.

We will get the same error number for missing dot "." or colon ":"

1. have you missed any open and closing bracket ? 

 2. Have you missed any colon or semicolon or dot ?  along with that refer the below link and check your code.

http://msdn2.microsoft.com/en-us/library/ftyyzdhb(vs.80).aspx 


Regards
Ganesan S
"Hard Work Never Fails"

Please "Mark as Answered" if helpful for you.
0
ganesansankar
11/23/2007 12:12:12 PM

 Hi there,

 If you are using data bound control like datagrid, datalist.....use  "<%#  %> "

 

or else use "<%= %> "

  The problem is with the  code 

"<a href='?deleteid=(Convert.ToInt16(Eval("showit")))'>hent...</a>"

Change it to

 

"<a href='?deleteid=" + Convert.ToInt16(Eval("showit")) + "'>hent...</a>"

 Hope it may helps you..

 

 Srinath

Dont forget to click "Mark as Answer" on the post that helped you.
It marks your thread as Resolved so we will all know you have been helped.

srinathgnath

visit blogger.code4asp.net, srinathgnath.blogspot.com
jobsnwalkins.blogspot.com
0
srinathgnath
11/23/2007 12:31:33 PM

Thanks for your reply.

I am using datagrid that why i used <%# %>  in aspx page. If u used this <%= %>. It is showing error.Because it is a vbscript delimiters.

Ofcourse i used " this twice. if i used ' sing quote its throwing error.

0
Aarowne
11/23/2007 12:33:59 PM

 

thanks alot srinathgnath Big Smile
0
Aarowne
11/23/2007 12:44:50 PM

 

Hi there, You can do the same from code behind..

 

Write the code for the same...

in Itemdatabound.... and use a literal controlin the design..

 

Srinath 


srinathgnath

visit blogger.code4asp.net, srinathgnath.blogspot.com
jobsnwalkins.blogspot.com
0
srinathgnath
11/23/2007 1:01:04 PM
Reply:

Web resources about - Compiler Error Message: CS1003: Syntax error, ':' expected - asp.net.web-forms

Resources last updated: 1/4/2016 8:52:35 PM