I have an assignment where I have to use c# and vb in the same project. After searching it seemed a website would be best for this in visual studios and it had been going relatively well. I ran into a problem when I was asked to have a label and a button. The Button is suppose to use vb code and the label is suppose to use c#. My initial response was to create two aspx pages and add the button to one and the label to the other and then no problems really came up. However I’m wondering if it’s possible to use the same aspx page for both items and still have the vb coded button and c# coded label? If it is possible how do you do that sort of thing?
All insight is appreciated, thanks.
You’ll want to use a
UserControl. The user control can be written in either C# or VB, and then it can be added to an application page that’s coded in the other language. When using a User Control, from the outside, you don’t need to know if it was written in C# or VB, and it’s designed to go into a page and play nicely with other controls, so you don’t need to try to figure out how to combine two pages together in the browser.