Click here to Skip to main content
15,916,215 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using ViewBag.JobNo and it is not working. I am using ViewBag.JobNo in my controller as:

ViewBag.JobNo = "test";

In my View, I am using it as:

@Html.TextBox("txtJobNo", (string)ViewBag.JobNo , new { @class = "col-md-10 form-control" })

I am getting my TextBox empty.

But when I am using ViewBag.Title in place of ViewBag.JobNo, it is working fine.

Please help me, if you have some idea. Thanks..

What I have tried:

I am using ViewBag.JobNo in my controller as:

ViewBag.JobNo = "test";

In my View, I am using it as:

@Html.TextBox("txtJobNo", (string)ViewBag.JobNo , new { @class = "col-md-10 form-control" })

I am getting my TextBox empty.

But when I am using ViewBag.Title in place of ViewBag.JobNo, it is working fine.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900