Check Model in JQuery
I have a property on my model called CanExport
. My view inherits this model like so:
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<Chatham.Web.Models.Indications.ModelBase>" %>
How do I in javascript, check if that property is true
or 开发者_运维问答false
?
Thanks!
You can use getAttribute
object.getAttribute('CanExport');
Ugh I'm so mad at myself. I put in code to do this and thought it didn't work which was why I asked the question, but I realized that I didn't build. Sorry!
Here's the code if anyone is interested:
var showexport = "<%= Model.CanExportHistory%>"
精彩评论