ImageUrl='<%#Eval("Name","../Master Pages/DisasterImages/") %>'+'<%#Eval("Request.QueryString["DisID"].ToString()/{0}") %>'
DisID is a folder name.
What I want is to display the images in the directory. I have done it using a repeater control. The problem is now I want to get the folder name in the QueryString. How can I do this? Above is the code I have tried without achieving the desired oute...
Any help would appreciated.
Thank you!
ImageUrl='<%#Eval("Name","../Master Pages/DisasterImages/") %>'+'<%#Eval("Request.QueryString["DisID"].ToString()/{0}") %>'
DisID is a folder name.
What I want is to display the images in the directory. I have done it using a repeater control. The problem is now I want to get the folder name in the QueryString. How can I do this? Above is the code I have tried without achieving the desired oute...
Any help would appreciated.
Thank you!
Share Improve this question edited Oct 13, 2016 at 21:12 BangEqualsDestructor 651 silver badge11 bronze badges asked Jun 17, 2010 at 8:33 chamarachamara 12.7k34 gold badges138 silver badges214 bronze badges 01 Answer
Reset to default 4use <%= instead of <%#. Example:
<%= Request.QueryString["DisID"] %>
I have noticed another issue with your code, you need to be careful when using quotes inside a string. You need to escape them. Therefore
"Request.QueryString["DisID"].ToString()/{0}"
should look like this
"Request.QueryString[\"DisID\"].ToString()/{0}"
Notice the backslash that serves for escaping characters.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745047287a4608177.html
评论列表(0条)