Click here to Skip to main content
15,900,907 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:

I do want to read a parameter value from the url. I do not mean in the code behind, instead I want to use it in the aspx-file.

This is the url: ... document.aspx?name=filename.pdf

Now I want to get the filename to display the file in an iframe:

<iframe src=""+"<%$ QueryString:name%>" height="800" width="800" name="pdf">Text</iframe>

This doesn't work. How can I get the filename from the url?


you can check this once

<% if (Request.QueryString["name"] != null)
     { %>
     <iframe src='default23.aspx?name=<%=Request.QueryString["name"].ToString()%>' width ="400" height ="400"></iframe>

   <% }%>

All the Best.
Share this answer
try this...
Share this answer
chris085 14-Oct-11 7:47am    
That's just the name of the frame. I do want to add the parameter to the src.
devildx2050 15-Oct-11 2:34am    
You will find these parameters in the Request object:
<%=Request["name"] %>
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900