Url.Content returns null when it has value

ilter

I have an interesting error which I couldn't debug and find information online. Got a screenshot of the error. Please see...

enter image description here

This is the details view of my controller. There are many records in that database table and some of them returns that error when I click the records on the list view. Most of them shows the page with no problems, but some of them does this. As you see in the picture, Model.Description has a value, and a long one, and it's far from being a null or empty value.

That is the Details controller which returns the db record to the view.

public ActionResult Details(string title, int id)
{
    if (id == null)
    {
        return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
    }
    Page page = db.Pages.Where(p => p.MenuElement_Id == 2).First(p => p.Id == id);

    if (page == null || HelperFuncs.URLFriendly(page.Title) != title)
    {
        return HttpNotFound();
    }
    return View(page);
}

FYI, before the error appears, controller returns the view with no problems. And Model.Description has value when it returns the view. After that, pressing F10 brings me to the view and shows up error which is shown in the below picture.

May be you experienced such an issue, could you please tell me where to debug and look for the solution of that error? If you need more information, I will provide what you need.

Satpal

You don't need to use Url.Content(), if you simply want to display text. So you should simply remove it.

Use

<div>@Modal.Description</div>

instead of

<div>@Url.Content(Modal.Description)</div>

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

jsp form returns null value in one input

분류에서Dev

Value from JavaScript object returns null

분류에서Dev

GetBindingExpression returns null when I have a binding

분류에서Dev

Trigger an action when an URL has been visited

분류에서Dev

Sum returns value when should return 0

분류에서Dev

Angularjs - url params: When clicked returns to angular vars in the url

분류에서Dev

Retrieve URL Value but keeps returning (NULL)

분류에서Dev

canvas.getContext('2D') returns null value

분류에서Dev

Why values in ArrayList always returns null as first value in Java?

분류에서Dev

Textview.setText(addressString) returns null value error

분류에서Dev

Why does NVL2 returns NULL when it's not expected?

분류에서Dev

Javascript: document.body.appendchild has a null value

분류에서Dev

img src attribute returns the url of the page when blank

분류에서Dev

Laravel ORM relationship returns error when value not present in DB

분류에서Dev

When i run cron for a database function it returns me the same value

분류에서Dev

Google Storage signedUploadUrl, fetching upload url returns: Bad content type. Please use multipart

분류에서Dev

JMeter JDBC Call returns the value as parameter name if the value received from DB is null

분류에서Dev

Url.Content에 값이 있으면 null이 반환됩니다.

분류에서Dev

Django GraphQL returns null

분류에서Dev

Malloc returns null

분류에서Dev

Request .Form returns null

분류에서Dev

SQL Server how to set a default value when the column is null

분류에서Dev

Preserve $null value when creating new Powershell session with arguments

분류에서Dev

String manipulation returns right value when print statement is in, breaks when removed

분류에서Dev

Why does new $class; return null when class_exists($class) returns true?

분류에서Dev

Display content based on URL

분류에서Dev

JSON returns [null,null] in my app

분류에서Dev

CONCAT in stored procedure returns null

분류에서Dev

Why PrinterState always returns null?

Related 관련 기사

  1. 1

    jsp form returns null value in one input

  2. 2

    Value from JavaScript object returns null

  3. 3

    GetBindingExpression returns null when I have a binding

  4. 4

    Trigger an action when an URL has been visited

  5. 5

    Sum returns value when should return 0

  6. 6

    Angularjs - url params: When clicked returns to angular vars in the url

  7. 7

    Retrieve URL Value but keeps returning (NULL)

  8. 8

    canvas.getContext('2D') returns null value

  9. 9

    Why values in ArrayList always returns null as first value in Java?

  10. 10

    Textview.setText(addressString) returns null value error

  11. 11

    Why does NVL2 returns NULL when it's not expected?

  12. 12

    Javascript: document.body.appendchild has a null value

  13. 13

    img src attribute returns the url of the page when blank

  14. 14

    Laravel ORM relationship returns error when value not present in DB

  15. 15

    When i run cron for a database function it returns me the same value

  16. 16

    Google Storage signedUploadUrl, fetching upload url returns: Bad content type. Please use multipart

  17. 17

    JMeter JDBC Call returns the value as parameter name if the value received from DB is null

  18. 18

    Url.Content에 값이 있으면 null이 반환됩니다.

  19. 19

    Django GraphQL returns null

  20. 20

    Malloc returns null

  21. 21

    Request .Form returns null

  22. 22

    SQL Server how to set a default value when the column is null

  23. 23

    Preserve $null value when creating new Powershell session with arguments

  24. 24

    String manipulation returns right value when print statement is in, breaks when removed

  25. 25

    Why does new $class; return null when class_exists($class) returns true?

  26. 26

    Display content based on URL

  27. 27

    JSON returns [null,null] in my app

  28. 28

    CONCAT in stored procedure returns null

  29. 29

    Why PrinterState always returns null?

뜨겁다태그

보관