Click here to Skip to main content
15,909,645 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
it is possible,i ues <% %> for assign QueryString ID,to src "img" tag such as below code:

<form id="form1"  runat="server">
    <div>
    <img src="Default.aspx?ID=<%Request.QueryString[ID]%>/>

    </div>
    </form>
Posted
Updated 17-May-11 23:14pm
v4
Comments
Sandeep Mewara 18-May-11 4:31am    
Elaborate your scenario. What you are trying right now would not work.
[no name] 18-May-11 4:43am    
this code not work,but i want to know whether is possible?

Assuming ID is the key and not a property on the form/control this should work:

<img src='Default.aspx?ID=<%Request.QueryString["ID"]%>' />


You might need <%= rather than <% I can't remember, and I can't test: VS is currently broken on my machine...
 
Share this answer
 
v2
This is very ugly code though, you should try to avoid doing it. A better idea is to put a literal contol on your page, and set it's value in your code behind. Or use the ASP.NET image control, and set it's URL in the code behind.
 
Share this answer
 
v2

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