The server tag is not well formed.

G

Guest

Hi all,
I'm getting the 'The server tag is not well formed.' error for this tag in
aspx page

<a href="javascript:eek:penPopup('default.aspx?EmpID=<%# Eval("EmpID")
%>&Type=1')" id="lnkDestination" name="lnkDestination"
accesskey="lnkDestination" runat="server">Show</a>

Can anybody please help me in resolving this?

Thanks for your help
Srinivas
 
D

David Longnecker

Should be able to resolve this by switching your quotes. Single quotes for
your properties and doublequotes inside the javascript.

<a href='javascript:eek:penPopup("default.aspx?EmpID=<%# Eval("EmpID") %>&Type=1")'

id='lnkDestination'
name='lnkDestination'
accesskey='lnkDestination'
runat='server'>
Show
</a>
 
G

Guest

Howdy,

<a href="<%#
String.Format("javascript:eek:penPopup('default.aspx?EmpID={0}&Type=1\')",
Eval("EmpID")) %>" id="lnkDestination" name="lnkDestination"
accesskey="lnkDestination" runat="server">Show</a>

Hope this helps
 
G

Guest

David,
Thanks for the reply
After changing it also it's not working.
Instead of the Caption 'Show' it is displaying entire pagename and id name
and accesskey names.
One more thing is if i remove the runat tag then everything is working fine

Thanks
 
G

Guest

Howdy,

Forgot ASP.NET forums will escape &quot;

It should be (hopefully):

<a href="<%#
String.Format(&quot;javascript:eek:penPopup('default.aspx?EmpID={0}&Type=1\')&quot;,
Eval(&quot;EmpID&quot;)) %>" id="lnkDestination" name="lnkDestination"
accesskey="lnkDestination" runat="server">Show</a>
 

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,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top