ASP.NET ScriptManager CompositeScript doesn't work with javascript that requires querystring param
I have a jQuery function in a .js file, and the function requires a querystring paramete开发者_JS百科r to be passed.
If I try to use the CompositeScript feature in the ScriptManager, it pukes on the file that has the querystring. Is there any way around this?
I was trying to do the same thing and the error I got was something like "URL was not a virtual path" so I'm assuming the path must be virtual. So you may not be able to do this as appending the querystring variable to the path will cause the URI to choke.
You could set your variable in the page or masterpage if global, thus you wouldn't need to pass a querystring.
Might be a way to do what you are accomplishing, but my guess would be that you would have to add in another step, like a route to the jsfile.js?qv=whatever to jsfile.js, or add in an httphandler. Probably more trouble than it is worth.
Just guesses.
精彩评论