开发者

How to use a VB usercontrol on a C# page?

开发者 https://www.devze.com 2022-12-31 22:38 出处:网络
Hopefully someone will be able to point me in the right direction. I\'ve created a usercontrol in VB that handles paging more efficiently than the DataPager (at least for very large datasets).I\'d li

Hopefully someone will be able to point me in the right direction.

I've created a usercontrol in VB that handles paging more efficiently than the DataPager (at least for very large datasets). I'd like to use it in a C# project, but I've been having trouble getting it to work.

I've tried simply adding PagingControl.ascx to the C# project, but when I do that the markup and VB code behind don't seem to see each other. --Is this a namespace issue?

I've tried adding the PagingControl.ascx to its own VB project, then adding that project to the C# project's solution, as well as a reference. --That almost works. I can register the PagingControl userco开发者_Go百科ntrol in the markup. I can access the usercontrol's properties in the code behind, but any property that involves the UI of the usercontrol fails.

Its seems as if the usercontrol's form hasn't had a chance to load by the time the C# page's Page_Load event handler fires. --Maybe this is an "order of operations" problem? At what point in the C# page's lifetime should a usercontrol's form be loaded?

If anyone has any ideas or insight, I'd really appreciate it. Thanks in advance.


You can't have VB and C# code in one project - you have to split it and reference the VB part in the C# project. To the other question: no idea, as I don't do web dev.

0

精彩评论

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