why and when these 2 different tags are used?

Thanks

General rule of thumb in C# (not sure about VB) is that @ basically indicates a literal value of the variable to follow.

@varName differs from varName (assuming both are string variables) in that the @ version will ensure that every character of the string is read and none of the standard 'operator' or 'escape' characters are read by the compiler as their code counterparts.

Not 100% that this applies in the same way with the <% %> format but I'm pretty sure it does.

As for the <% %> formatting it's generally a front-end invoke of a variable within the webpage scripting, for more detail... well honestly I don't have any links lol sorry if this doesn't answer your question but it should at least be an answer to part of it :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.