load a user control programmatically in to a html text writer

后端 未结 3 680
执笔经年
执笔经年 2020-12-29 15:26

I am trying to render a user control into a string. The application is set up to enable user to use tokens and user controls are rendered where the tokens are found.

<
3条回答
  •  轮回少年
    2020-12-29 16:21

    I took Hauge's/ Scott Guthrie's method above and tweaked it so that you don't need to use reflection, or modify a UserControl to implement any special interface. The key was I added a strongly typed callback that the RenderView method above calls, instead of doing reflection.

    I blogged the helper method and usage here

    HTH, Jon

提交回复
热议问题