@Html.TextBox("txtProspectiveStudentsSurveyId", @ViewBag.ProspectiveStudentsSurveyId)
şeklinde yapınca aşağıdaki şekilde hata aldım:
CS1973: 'System.Web.Mvc.HtmlHelper<dynamic>' has no applicable method
named 'TextBox' but appears to have an extension method by that name. Extension
methods cannot be dynamically dispatched. Consider casting the dynamic arguments
or calling the extension method without the extension method syntax.
@Html.TextBox("txtProspectiveStudentsSurveyId", ViewBag.ProspectiveStudentsSurveyId) şeklinde yaptım yine aynı hatayı aldım.
Doğrusu:
@Html.TextBox("txtProspectiveStudentsSurveyId", (string)ViewBag.ProspectiveStudentsSurveyId)
şeklinde casting yapmak gerekiyormuş.
Kaynak:
http://stackoverflow.com/questions/7190682/add-html-textbox-value-from-viewbag
C#, .NET, .Net Core
ASP.NET MVC, ASP.NET Web Forms, ASP.NET Core
HTML 5, CSS 3, Javascript, jQuery, Bootstrap
Entity Framework, NHibernate, Dapper
Sql Server, MySql, Oracle
Windows Server, Ubuntu, Debian, Pardus
Xamarin Forms, Android Studio
--- The future of the open web platform is looking very bright!
--- .NET is a free, cross-platform, open source developer platform for building any app.
Google Analytics İzleme
Kaydol:
Kayıt Yorumları (Atom)
Hiç yorum yok:
Yorum Gönder