pass static class's string constant into clientside code
Passing a serverside variable into a client isn't anything too rough
var Variable = '<%= ServerVaraible %>'
where ServerVaraible is something accessible publicly in the codebehind,
easy peasy
now lets say I have a Static Class as such
namespace Server.Helpers
{
public static class QueryStringConstants
{
public static string CARID = "carId";
}
}
Why can't I go: var Variable = '<%=
Server.Helpers.QueryStringConstants.CARID %>'
if I do this i get an error saying
'System.Web.HttpServerUtility' does not contain a definition for 'Helpers'
and no extension method 'Helpers' accepting a first argument of type
'System.Web.HttpServerUtility' could be found
I am sure I am ment to be declaring something, but I am not 100% sure
what......
No comments:
Post a Comment