开发者

Check Model in JQuery

开发者 https://www.devze.com 2023-03-01 22:51 出处:网络
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>\" %

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%>"
0

精彩评论

暂无评论...
验证码 换一张
取 消