Solved

dynamic URL string -- asp.net mvc4 ?

Posted on 2013-10-23
5
585 Views
Last Modified: 2013-10-24
Below Details.cshtml "123456" code works
How can I get below ""model.ID"" to work ?
---------------------------------------------------------------

                @Html.DisplayFor(model => model.ID)

                <img src="http://www.barcodesinc.com/generator/image.php?code=123456&style=197&type=C128B&width=200&height=50&xres=1&font=3">

                <img src="http://www.barcodesinc.com/generator/image.php?code= ""model.ID"" &style=197&type=C128B&width=200&height=50&xres=1&font=3">
0
Comment
Question by:finance_teacher
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39595163
Put an @ in front of it.

e.g.

<img src="http://www.barcodesinc.com/generator/image.php?code=@model.ID&style=197&type=C128B&width=200&height=50&xres=1&font=3">

Open in new window

0
 

Author Comment

by:finance_teacher
ID: 39595241
That fails, so I tried the below which also fails
How can I fix ?

                <img src="http://www.barcodesinc.com/generator/image.php?code= + @model.BillingDate + &style=197&type=C128B&width=200&height=50&xres=1&font=3">
0
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 39596275
Sorry, the "model" needs to be capitalized:

<img src="http://www.barcodesinc.com/generator/image.php?code=@Model.ID&style=197&type=C128B&width=200&height=50&xres=1&font=3">

Open in new window


Little "m" is something different.
0
 

Author Comment

by:finance_teacher
ID: 39596896
How can I have it be TWO values ?
---------------------------------------------------------------------------------------------------------------------
Below works, showing both values.
                <img src="http://www.barcodesinc.com/generator/image.php?code=@Model.ID@Model.IFSWO&style=197&type=C128B&width=200&height=50&xres=1&font=3">
---------------------------------------------------------------------------------------------------------------------
Below fails, trying to add a space between the values.
                <img src="http://www.barcodesinc.com/generator/image.php?code=@Model.ID" "@Model.IFSWO&style=197&type=C128B&width=200&height=50&xres=1&font=3">
0
 

Author Comment

by:finance_teacher
ID: 39596899
Below works by just putting a space, no " " needed.

                <img src="http://www.barcodesinc.com/generator/image.php?code=@Model.ID @Model.IFSWO&style=197&type=C128B&width=200&height=50&xres=1&font=3">
0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question