html-helper


Getting Class Property Values from Linq Expression In Html Helper MVC3


I have an HTML helper that I need to pass an Object to. This Object is a class that has some Properties on it that I would need to access in the helper. The actual base class of this object is a generic type so I decided that I would use a Linq expression and pass it the object.
Here is the method signature:
public static MvcHtmlString PartyDetailsField<TModel, TProperty>(this HtmlHelper<TModel> helper, string controlLabelText, Expression<Func<TModel, TProperty>> expression, IEnumerable<IDetailsConfiguration> configuation, string width = "")
Here is how I use the control:
#Html.PartyDetailsField("Identifiers", m => m.Person, Model.IdentifierConfiguration, "186px")
I need the instance information from m.Person. How can I get the object instance and access the properties of the class instance from the expression? Is there a better way of doing this?
suggest reading this post http://blogs.msdn.com/b/csharpfaq/archive/2010/03/11/how-can-i-get-objects-and-property-values-from-expression-trees.aspx

Related Links

How can i resize image in html-helper tagbuilder
TextBoxFor title to display the current text
Converting C# Razor view syntax for checkboxlist into VB.Net
Table of content is not proper in chm file
Web helpers for MVC 5?
asp.net mvc3 or mvc4 html helper is not working
Configure the Javascript function + Html Helper
Displaying multiple values with Telerik ASP.Net MVC extensions with the ForeignKey column
Custom html helpers in MVC 4
Return multiple checkbox from Custom html helper in mvc 3r
Getting Class Property Values from Linq Expression In Html Helper MVC3
format htmlhelper date field to dd/mm/yyyyy
How to create internal Linking inside CHM help file
simple_html_dom timer?
Printing Html with razor view engine
How to set the default page for a .CHM file in HTML Help Workshop?

Categories

HOME
sendgrid
xmpp
maven-3
yarn
c#-2.0
win32gui
fsm
ebean
mouse
autotools
slick-slider
gorm
facebook-php-sdk
communication
workload-scheduler
graphlab
jsdoc
flux
alpine
scichart
ml
java-3d
scriptcs
cloudhub
tar
mps
hammerspoon
crosstab
status
poltergeist
chromebook
rst2pdf
windows-server-2000
r-raster
fabric8
react-chartjs
caret
windows-dev-center
bytecode-manipulation
automake
xenforo
streamreader
greenrobot-eventbus
cookiecutter-django
android-tabhost
dynamic-reports
segment
dotnetzip
kbuild
query-performance
crosswalk-runtime
nxt
removechild
azure-virtual-network
py2app
thrust
gstreamer-0.10
simplewebrtc
skype4py
make-install
bluemix-app-scan
suffix-tree
cloudbees
freedesktop.org
tcpserver
separator
prerequisites
feedback
wordml
quicklisp
angular-leaflet-directive
embedded-code
ibaction
kineticjs
geonetwork
offloading
titanium-modules
websocket4net
issuu
has-many-through
android-2.2-froyo
ivyde
google-cloud-save
cos
xamlparseexception
cassini-dev
anonymous-methods
simba
multipage
chrono
osql
nsdatecomponents
locate
iphone-web-app
lang
createwindow
sproutcore-2
sef
avatar
zune
grid-system
.net-1.0

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App