添加C#Web窗体VB Web应用程序 [英] Adding C# Web Form to VB Web Application

查看:400
本文介绍了添加C#Web窗体VB Web应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么办法一个C#Web窗体添加到是写在VB.NET的ASP.NET 4.0 Web应用程序?我有一个ASP.NET 2.0的网站的,我最近转换到ASP.NET 4.0的 WEB应用程序的。它主要是写在VB.NET与有C#code屁股几页。

Is there any way to add a C# Web Form to an ASP.NET 4.0 Web Application that is written in VB.NET? I had an ASP.NET 2.0 WEB SITE that I recently converted to an ASP.NET 4.0 WEB APPLICATION. It was mostly written in VB.NET with a couple pages that had C# code behinds.

我看过下面的文章(约多张语言的端部):

I've read the following article (the end section about mulitple languages):

http://msdn.microsoft.com/en-us/library/ t990ks23.aspx

但它似乎并没有帮助有以下两个原因

But it does not seem to help for the following two reasons

1)当我转换我的网站的应用程序,它似乎并没有添加APP_ code文件夹中所有
2)我不希望只写一个简单的类,其实我是想能有一个C#code添加Web窗体后面

1) When I converted my site to an application, it didn't seem to add an APP_CODE folder at all 2) I'm not looking to just write a simple class, I actually want to be able to add a WEB FORM with a C# code behind

当我尝试添加一个新的项目,我选择我要添加哪些类型的项目,我只给选项中增加一个Visual Basic Web表单。

When I try to add a new item and I select which type of item I want to add, I am only given to option to add a VISUAL BASIC web form.

我有一个解决办法现在。如果我需要用C#code后面一个新的网络形式,我走我的旧的C#网络形式之一,只是复制和粘贴的形式和C#code落后进入项目,然后将其重命名和更改类命名为好。然后,我让我的变化,做我需要做的。它似乎工作,但我只是想知道是否有更简单的方法。

I have a workaround right now. If I need a new web form with a C# code behind, I take one of my old C# web forms and just copy and paste the form and C# code behind into the project and then rename it and change the class name as well. Then i make my changes and do what I need to do. It seems to work, but I was just wondering if there was an easier way.

您可能会问,为什么要把C#的形式在我的VB应用程序。我写我的应用程序在VB中(不精通C#,但我可以读取它)。我有一个程序员工作对我来说是更有效的使用C#。我真的没有预算花费数周/数月让她与VB加快

You might wonder why want to put C# forms in my VB app. I wrote my app in VB (not well versed in C# but I can read it). I have a programmer working for me that is much more efficient with C#. I don't really have the budget to spend weeks/months getting her up to speed with VB

推荐答案

你能不能把升C Web表单另一类库用户控件,然后只是参考并将其拖放到页面?

Can you put the C sharp web forms in another class library as user controls then just reference and drop them on the pages?

您可以在web配置中使用的所有页面引用的程序集

You can reference the assembly in the web config to use in all pages

<一个href=\"http://weblogs.asp.net/scottgu/archive/2006/11/26/tip-trick-how-to-register-user-controls-and-custom-controls-in-web-config.aspx\" rel=\"nofollow\">http://weblogs.asp.net/scottgu/archive/2006/11/26/tip-trick-how-to-register-user-controls-and-custom-controls-in-web-config.aspx

这篇关于添加C#Web窗体VB Web应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆