resource in OnClientClick

S

Steven Cheng[MSFT]

Hello Dave,

The problem here is that we can not use nested inline expression in aspx
template. Both <%# %> and <%$ %> are top level expression.

For your scenario, you can actually define a custom helper function for
retrieve resource value from resource file. The ASP.NET 2.0 page class
provide "GetLocalResourceObject" and "GetGlobalResourceObject" to
programmatically retrieve resource value from local or global resource
files. They can replace the <%$Resource .... %> expression. See the
following msdn reference:

#How to: Retrieve Resource Values Programmatically
http://msdn2.microsoft.com/en-us/library/ms227982.aspx

So your final code can be changed to below style:


OnClientClick='<%# Eval("UserName",
ResourceHelper("Windward","Admin_Confirm")) %>

Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 

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

Top