Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 460
  • Last Modified:

Using an Request Querystring in a external JS file

Hi,

I have an ASP/VB page that loads an Javascript file i.e.

Main.asp

<script type="text/javascript" src="js/emaillist.js"></script>


But within the emaillist.js file I need a <%=Request.QueryString("userID")%>

How can this be used?

Thanks
0
sanjshah12
Asked:
sanjshah12
1 Solution
 
neeraj523Commented:
hello

try this

<script>
var mystr = "<%=Request.QueryString("userID")%>";
</script>
<script type="text/javascript" src="js/emaillist.js"></script>

in emaillist.js file, you can use 'mystr' variable which will return you the value of Request.QueryString("userID")..
0
 
sanjshah12Author Commented:
Thanks neeraj that works great!
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now