如何使用mvc 4从资源文件中将图像文件扩展到模型中? [英] How to get image file extension into model from resource file using mvc 4?

查看:46
本文介绍了如何使用mvc 4从资源文件中将图像文件扩展到模型中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi Team,

我有一个模型,我正在使用下面的属性 -

I have a model and i am using below property-

[LocalizedFileType(" png",ResourceName =(ResourceFile.RSetting),ResourceKey = SettingResources.FileTypeValidation)]

[LocalizedFileType("png", ResourceName = (ResourceFile.RSetting), ResourceKey = SettingResources.FileTypeValidation)]

public HttpPostedFileBase Image {get;组; }

public HttpPostedFileBase Image { get; set; }

}

我传递了"png"硬编码为  LocalizedFileType类参数。它按预期工作。现在,我正在寻找,我可以保持"png"到某个地方进入一个公共设置,我可以使用它,比如xml或web.config文件。

i have passing "png" hardcoded to LocalizedFileType class parameter.It works as expected. Now, what i am looking, can i keep "png" to somewhere into a common setting, from where i can use it, like xml or web.config file.

如果有人以前在使用它,请提出一些解决方案。

Please suggest some solution if anybody previously work on it.

谢谢

推荐答案

Asp.net mvc有自己的
官方论坛
,您可以在那里发布您的问题以获得更好的帮助。
Asp.net mvc have their own official forum, you can post your question there for a better assistance.


这篇关于如何使用mvc 4从资源文件中将图像文件扩展到模型中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆