The server tag is not well formed.

  • Thread starter Thread starter Guest
  • Start date Start date
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:openPopup('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
 
Should be able to resolve this by switching your quotes. Single quotes for
your properties and doublequotes inside the javascript.

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

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

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

Hope this helps
 
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
 
Howdy,

Forgot ASP.NET forums will escape &quot;

It should be (hopefully):

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