Solved

dynamic URL string -- asp.net mvc4 ?

Posted on 2013-10-23
5
558 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
  • 3
  • 2
5 Comments
 
LVL 74

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 74

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

747 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now