开发者

Simple string templating in ASP.NET MVC

I have a bunch of database log messages containing references like Invoice 45 or Cas开发者_StackOverflow中文版e 123 which I want to parse to output links to the appropriate invoice or case when displaying to the user.

These are fairly simple to parse with RegEx and replace with an action link using an ASCX display template, but is there a right way to do this? I imagine this means writing a parser to tokenise the string and prevent any potential circular references.


An HTML helper is probably a better fit - the parsing / display doesn't do anything that you could put in the ascx that isn't better handled in code.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜