Click here to Skip to main content
15,892,072 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
i converted 2.0 to 4.0 framework. but server tag is not well formed is displayed

my error line is

XML
<span id="spanCommentMessage<%#Eval("Rownumber")%>" class="Sucmsg" style="display: none"
                                                              runat="server">
                                                              <asp:Label ID="Label1" runat="server" Text="The comments have been successfully saved."></asp:Label>
                                                          </span>
Posted
Comments
Prasad Avunoori 16-Sep-14 5:29am    
Try this.

<span id="spanCommentMessage<%#Eval('Rownumber')%>" class="Sucmsg" style="display: none"
runat="server">
vr reddy 16-Sep-14 5:31am    
no.. spanCommentMessage<%#Eval('Rownumber')%> is not a valid identifier error coming
Kornfeld Eliyahu Peter 16-Sep-14 5:32am    
The other way around!!!
Eval is a C# method and 'Rownumber' will give an error of invalid character constant!!!
vr reddy 16-Sep-14 6:10am    
hello plz reply yar
vr reddy 16-Sep-14 5:38am    
hey 2.0 framework is working but 4.0 is not working

Remove runat="server"...
HTML
<span id="spanCommentMessage<%# Eval(" rownumber=")%>" class="Sucmsg" style="display: none" />

The main problem is that
ASP.NET
<span id="id<%# Eval("Hello") %>"  runat="server" />

will not create a server side object at all, where this
ASP.NET
<span id='id<%# Eval("Hello") %>'  runat="server" />

(notice the single quote) will create a server side object with id id<%# Eval("Hello") %>. That of course leads to a syntax error.

If you think about it a bit it is obvious! ASP.NET engine can not create a server side object for some dynamic declaration!
 
Share this answer
 
v2
Comments
vr reddy 16-Sep-14 6:25am    
its working but how to use that id in code behnd
Kornfeld Eliyahu Peter 16-Sep-14 6:30am    
You can't. You can't use Eval in id attribute with server-side object...
vr reddy 16-Sep-14 6:32am    
thank u
Kornfeld Eliyahu Peter 16-Sep-14 6:40am    
See updated solution...read it carefully!
vr reddy 16-Sep-14 6:36am    
sorry one more doubt.. recently 2.0 to 4.0 changed after changed below error coming
rsweb:ReportViewer
use like below

XML
<span id='spanCommentMessage<%#Eval("Rownumber")%>' class="Sucmsg" style="display: none"
                                                              runat="server">
 
Share this answer
 
Comments
vr reddy 16-Sep-14 5:38am    
not working.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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