A guide on connecting Request.QueryString[""] to Eval() in ASP.NET

ImageUrl='<%#Eval("Name","../Master Pages/DisasterImages/") %>'+'<%#Eval("Request.QueryString["DisID"].ToString()/{0}") %>'

Note: The folder name for this image directory is referred to as "DisID".

I am currently using a repeater control to display the images in the directory. However, I am facing an issue with retrieving the folder name from the QueryString. The code snippet above shows my attempt, but it has not produced the desired result...

If anyone could provide assistance on how to achieve this, it would be greatly appreciated.

Thank you in advance!

Answer №1

Try using <%= instead of <%#. For example:

<%= Request.QueryString["DisID"] %>

I came across another issue in your code related to the usage of quotes within a string. It's important to properly escape them. Therefore

"Request.QueryString["DisID"].ToString()/{0}"

should be written as

"Request.QueryString[\"DisID\"].ToString()/{0}"

Make sure to include the backslash for character escaping.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the best way to implement a dynamic sidebar component using React and Material UI?

I have been attempting to implement a responsive sidebar using React Material Design, but I am struggling to achieve the desired outcome. The main goal is for the page content to remain responsive when the sidebar is opened, without overlapping on the pag ...

When using the `.push` method, the array becomes null

Currently, I am in the process of developing an angular application. Within my component's .ts file, there exists an array structured as follows: public myArray = []; public dataFromAPI = []; In a particular method within this component, whenever I ...

I am curious how to utilize Puppeteer to iterate through an array of links, moving to the initial link, closing the tab, and repeating the process

In my current setup, the script navigates to the first link I specify in the following manner: (async () => { let funkoUrl = "https://www.cardboardconnection.com/brand/funko/funko-pop"; let browser = await puppeteer.launch({ headless: false, ...

What is the best way to show a nested div element within a v-for loop in Vue.js?

One interesting feature of my coding project is that I have an array nested within another array, and I iterate through them using two v-for loops. The challenge arises when I try to display a specific div in the second loop only upon clicking a button. ...

Is it possible to host a .NET 2.0 web application using a .NET 4.0 application pool?

Is it possible to host a .NET 2.0 running web application with a .NET 4.0 App Pool? In my Web Application's Web.config file, I have added the following node: <startup> <supportedRuntime version="v2.0.50727"/> </startup> By add ...

Leverage information stored in the DataTable across all forms

When I'm working in the class, I execute a stored procedure that returns a DataTable. public DataTable fetchUserInfo(int userID) { DataTable data = new DataTable(); string connection = ConfigurationManager.ConnectionStrings["myco ...

Transform an array into an array of objects

I currently have a collection of words stored in a .json file Here is an example: [ "apple", "banana", "orange" ] My objective is to create an object for each word Similar to this structure: [ { word: "appl ...

What is the best approach for incorporating sub-navigation within a page popup in a Next.js project?

In the midst of my Next.js project, there is a requirement to showcase a chat popup consisting of multiple sub-pages like user registration, conversation page, and more. Hence, seamless navigation inside this popup is necessary. The idea is not to alter th ...

Issue with Mongoose: Create operations are not functioning properly right after performing Delete operations

I need to refresh my collection by deleting all existing documents and then repopulating them with new data from an API call. But when I try running the delete operations first, no new documents are created. Below is a simplified version of my controller ...

Is ASP.NET Master Page combined with pageLoad() function causing issues with jQuery functionality?

Within my MasterPage, I have a ScriptManager that references my jquery.js file. This has consistently worked without any issues, as all content pages using jquery function properly. Recently, I implemented the following javascript script block at the conc ...

Locate the class ID and refine the search results by another class

I am currently working on a task that involves extracting the first <li> element's id where it has the class name my_class, and checking if the <span> with the class Time contains a ":" using jquery. Below is the sample HTML structure: & ...

Passing variables through a promise chain and utilizing the finally method

My current endeavor involves constructing a log for an Express API, yet I am encountering difficulties in extracting the data for logging. I have successfully logged the initial req and res objects within the finally block, but I am uncertain about how to ...

Storing a table structure in a variable using JavaScript

Kindly review this arrangement: 1 | 2 | 3 | .... ---------------------------------------------------------- 2016 100 2000 500 2015 540 450 1200 2014 120 230 660 I am seeking a method ...

Blending components from two arrays in a designated sequence

Currently, I am dealing with 2 arrays selectedERO[] = {"Device A, Device B, Device C"} selectedLinks[] = { "Port A1 - Port B1, Port B2 - Port C1" ) I am looking to create a pathway from device A to device C, and I want it to be presented in an array for ...

The ng-grid selectRow function becomes undefined when the rowTemplate is being set

Setting the rowTemplate on the ngGrid options causes all rows selection functions, like selectRow, to become undefined. This issue is quite perplexing. For a demonstration, check out this link: http://plnkr.co/edit/m4GZftllwZzjYkEvXo3u?p=preview // main. ...

A reversible JavaScript function that swaps three items

Initially, I was tasked with creating a function that could either append the first color in an array to the end or reverse the order of colors. This is the function I created: // Obtain the colors from scope var colours = scope.colours; // Create the sw ...

Exploring grid loops in HTML5?

Creating a grid for my background was an interesting challenge. I used for loops on the X and Y axes to draw squares and form the grid. Now, I am wondering if there is a way to animate this grid so that it moves in both the x and y directions using +=1 on ...

Disable the second tab within an Angular md-tabs component

Are there any attributes in angular material md-tabs that can be used to disable a tab, similar to what is available in Bootstrap? $scope.tabs = [{ title: 'Dynamic Title 1', content: 'Dynamic content 1' }, { title: 'Dy ...

Taking a value from the querystring and using it in query1, then using another value from query1 in query2

In my asp application, the query string value serves as a parameter for SQL query1. The results of query1 are then used in query2. How can I pass a value from the result of query1 into query2 using asp? Note: The two tables come from different databases ...

Encountering a problem while attempting to update react-router from version 5 to version 6

I am encountering a typescript error after upgrading React-router-dom from v5 to v6. How can I resolve this issue? Below is the code snippet. Thank you in advance. export function withRouter(ui: React.ReactElement) { const history = useNavigate(); con ...