Solved

dynamic URL string -- asp.net mvc4 ?

Posted on 2013-10-23
5
599 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

Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

623 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