开发者

Linking to ascx file

I am utilizing controls in my asp.net application. I have a register tag the source of which needs to be dynamic. I am using the line below which开发者_Python百科 functions correctly when the full path is specified but when I change it to the variable I get a parser error. Any idea how I can go about doing this?

Thanks


It might be better to use Load Control from the code behind of the aspx page.


If I'm understanding you correctly — you can't use a variable in those directives (Page, Register, etc). They have to be constant expressions.

However, it is possible to dynamically load ASCX controls. You would have to do this in code, though, and it would not involve the Register tag.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜