What is <%$

  • Thread starter Thread starter wayneo
  • Start date Start date
W

wayneo

Can someone please explain this? I remember finding this on google
somewhere. It was the only way I could set something from the
resourcefile on a server object in the asp file.

This would be how I would do it when the button wasn't a server control

<input type="button" ID="_objCloseButton" value="<%=
Resources.Public.PUSearchFieldLookup_CloseButtonText %>" />

This is how I did it when it was a server control

<input type="button" ID="_objCloseButton" value="<%$ Resources:Public,
PUSearchFieldLookup_CloseButtonText %>" />


What exactly is the <%$ doing? Are the tow lines of code the same
except one is running at the server and the other isn't?
 
What I mean was:

Can someone please explain this? I remember finding this on google
somewhere. It was the only way I could set something from the
resourcefile on a server object in the asp file.

This would be how I would do it when the button wasn't a server control

<input type="button" ID="_objCloseButton" value="<%=
Resources.Public.PUSearchFieldLookup_CloseButtonText %>" />

This is how I did it when it was a server control

<input type="button" ID="_objCloseButton" value="<%$ Resources:Public,
PUSearchFieldLookup_CloseButtonText %>" runat="server" />

What exactly is the <%$ doing? Are the tow lines of code the same
except one is running at the server and the other isn't?
 
Can someone please explain this? I remember finding this on google
somewhere. It was the only way I could set something from the
resourcefile on a server object in the asp file.

This would be how I would do it when the button wasn't a server control

<input type="button" ID="_objCloseButton" value="<%=
Resources.Public.PUSearchFieldLookup_CloseButtonText %>" />

This is how I did it when it was a server control

<input type="button" ID="_objCloseButton" value="<%$ Resources:Public,
PUSearchFieldLookup_CloseButtonText %>" runat="server" />

What exactly is the <%$ doing? Are the tow lines of code the same
except one is running at the server and the other isn't?
 
Both run on server but the latter is a expression which fetches value from
specified resource and assigns it to value property of the <input> element
(server-side object). The former is basically a <%=%> construct whose value
is evaluated at Page's render stage and appended to the rendered output
(since it's HTML, it's just literal markup to which the returned value is
appended)
 

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

Back
Top