Up vote 0 down vote favorite share g+ share fb share tw.
I'm getting the following error Value of type 'System.Web.Mvc. MvcHtmlString' cannot be converted to 'Integer'. On @Html.
ActionLink("edit", "Edit", "Users", New With {. Id = Model. ID}, Nothing) Here's the code @If (Model.
IsUserMatch) Then @ @Html. ActionLink("edit", "Edit", "Users", New With {. Id = Model.
ID}) | manage openids End If Anyone know why this would be? EDIT: I was asked what the viewmodel looks like Imports System. Linq Imports UrbanNow.Core.
Extensions Namespace Domain Public Class UserViewModel Public Property UserName As String Public Property Email As String Public Property Website As String Public Property ID As Integer Public Property OpenIds As List(Of OpenID) Public Property UserAge As String Public Property About As String Public Property Slug As String Public Property LastSeen As String Public Property Region As String Public Property MemberSince As String Public Property Reputation As String Public Property isUserMatch As Boolean = False Private MarkDownSharp As MarkdownSharp. Markdown Public Sub New(ByVal user As User) Dim currentuser As Authentication. AuthUserData = Authentication.
CustomAuthentication. RetrieveAuthUser MarkDownSharp = New MarkdownSharp. Markdown With MarkDownSharp .
AutoHyperlink = False . AutoNewLines = True . EncodeProblemUrlCharacters = True .
LinkEmails = True . StrictBoldItalic = True End With ''# We want to ensure that the user has a username, even if they ''# haven't set one yet. What this does is check to see if the ''# user.
UserName field is blank, and if it is, it will set the ''# username to "UserNNNN" where NNNN is the user ID number. _UserName = If(Not user. UserName Is Nothing, user.
UserName, "User" & user.ID. ToString) ''# Nothing fancy going on here, we're just re-passing the object from ''# the database to the View. No data manipulation!
_Email = user. Email _Website = user. WebSite _ID = user.
ID _MemberSince = user. MemberSince ''# Get's a list of all of the user's OpenID's _OpenIds = user.OpenIDs. ToList ''# Converts the users birthdate to an age representation _UserAge = user.BirthDate.
ToAge ''# IE: 29 ''# Because some people can be real ass holes and try to submit bad ''# data (scripts and shitè) we have to modify the "About" content in ''# order to sanitize it. At the same time, we transform the Markdown ''# into valid HTML. The raw input is stored without sanitization in ''# the database.
This could mean Javascript injection, etc, so the ''# output ALWAYS needs to be sanitized. _About = Trim(Utilities.HtmlSanitizer. Sanitize(MarkDownSharp.
Transform(user. About))) ''# Removes spaces from Usernames in order to properly display the ''# username in the address bar _Slug = Replace(user. UserName, " ", "-") ''# Returns a boolean result if the current logged in user matches the ''# details view of the user in question.
This is done so that we can ''# show the edit button to logged in users. _isUserMatch = If(currentuser. ID = user.
ID, True, False) ''# Grabs the users last activity and formats it to a tag ''# for use with the timeago jQuery plugin _LastSeen = user.ActivityLogs.Reverse.FirstOrDefault. ActivityDate ''# Formats the users reputation to a comma Deliminated number ''# IE: 19,000 or 123k _Reputation = user.Reputation. ToShortHandNumber ''# Get the name of the users current Region.
_Region = user.Region.Region. FirstOrDefault End Sub End Class End Namespace asp. Net-mvc-3 razor link|improve this question edited Nov 22 '10 at 5:04 asked Nov 13 '10 at 22:45Chase Florell10.4k21779 87% accept rate.
I'm not seeing this error. What does your model look like? – marcind Nov 13 '10 at 23:15 It's a View Model - See edit.
– Chase Florell Nov 13 '10 at 23:27 Everything was working as expected when I was using MVC2 and the WebForms View Engine. It's the migration to MVC3 and Razor that's throwing me off. I just simply "modified" the existing views to move them from one to the other.
– Chase Florell Nov 13 '10 at 23:29.
Ah, my "Inherits" was wrong. I had @Inherits System.Web.Mvc. ViewPage(Of MyApp.Core.Domain.
User) when I should have used @ModelType MyApp.Core.Domain.User.
1 The base type for Razor pages is System.Web.Mvc.WebViewPage. Or as you've discovered you can just use the @ModelType keyword. – marcind Nov 14 '10 at 8:46.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.