Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strange problem with <%= %> blocks

Status
Not open for further replies.

Akusei

Programmer
Jul 15, 2003
90
US
I'm having an odd problem with my <%= %> blocks within the aspx page (well, actually all the problems have been on ascx pages).

I have this on an ASCX page:
Code:
<asp:HyperLink id=LnkProfile NavigateUrl="javascript:openNewWindow2('[URL unfurl="true"]http://www.xxxx.com/xxxx/xxxx.asp?id=<%=m_Id%>',[/URL] 500, 500);" Runat="server" Visible="False" CssClass="menu">Profile</asp:HyperLink>

Based on if m_Id is > 0, I make the link visible. After I make the link visible, it is rendered as such
Code:
<a id="whatever_LnkProfile" href="javascript:openNewWindow2('[URL unfurl="true"]http://www.xxxx.com/xxxx/xxxx.asp?id=<%=m_Id%>',[/URL] 500, 500);" Class="menu">Profile</a>

I am setting m_Id to a value and keeping it's state. I finally got fed up with this and made the NavigateUrl property equal to the javascript in code behind after the postback if m_Id > 0. This works because I am not using a <%= %> block, but my CSS style is all messed up after the link is made visible!!!!

Does anyone know why these things happen and if there is a fix... or maybe I'm doing something wrong.. any help would be appreciated.

Best regards,
Akusei
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top