Embed ASP.NET application in VB6 - asp.net

Does anybody have a clue how I might embed an ASP.NET 3.5 app inside a Visual Basic 6 application?
My other option is to provide a hyperlink inside the VB6 application that will open the ASP.NET app.....BUT I would prefer to embed the ASP.NET app within a tab control in VB6 if at all possible.
thanks in advance

For the auto-login to the .net app (assuming it's ASP.net) I would have the vb6 application login process write a session GUID to the database, and use it as a get or post variable when building a link to the .net application.
On the ASP.NET side, modify your MembershipProvider to honor a guid and username as evidence of successful authentication to the vb6 app.
There may be some additional security precautions you should take depending on how guarded your environment needs to be.

Realistically, your best option is probably to use the Web Browser control on a new tab, and point that at your ASP.NET application.
For auto-login, you SHOULD be able to have users login once. You'll probably need to enable a "remember me" feature in your ASP.NET application.

It'd be a two part process.
Create a .NET library to host asp.net, http://www.west-wind.com/presentations/aspnetruntime/aspnetruntime.asp.
Then use interopt to launch the library. Sounds like a really bad idea though.

That sounds like a terrible idea.
I think you should give more background on the situation so alternatives can be suggested.
EDIT: You say the VB6 app cannot be rewritten... but can it be edited? Depending on the complexity of the functionality in the ASP.Net app you could alter the ASP.Net app to include a web service and access that functionality from the VB6 app.

Related

ASP.Net web forms with ServiceStack.Net

I have a ASP.Net web application with around 100 forms. The coding is in VB.Net. We now want to add servicestack.net services inside this application. We want to do this so that session can be shared between the asp.net application and the web service and authentication can also be done via the web application. Please let me know if this is possible, if yes can one anyone point me to a sample application or provide me with the web.config and global asax file configuration that I should use for this.
Yup, servicestack supports asp.net web forms. You can try this nuget package . I don't really sure about session as service stack using something different mechanism for session. But yes you can share the session explained here in session section.
I hope this will help. Please let me know if any further details are needed.

How to setup RIA Services to use an existing ASP.Net membership base

I'd like to make an OOB Silverlight app based on the Silverlight Business Application template in Visual Studio. The template uses the default ASP.Net membership provider. I understand how to use that to add users and roles, etc. I've found plenty of tutorials on that. What I'd like to be able to do, is configure the Silverlight template so that it uses an existing ASP.Net membership base. We'd like this app to have a companion website (ASP.Net based).
To clarify: We've been able to setup an ASP.Net website and have created a SQL database with the required tables (aspnet_Users, aspnet_Membership, etc.). I'd like to configure a Silverlight app to access the same users and roles that are in those tables.
Can anyone help me out in terms of what I'd need to put in the Web.config? Do I just need a connection string? I'm new to ASP.Net authentication, but I'd rather use what ASP.Net gives me out of the box than have to write my own authentication service. I feel like this should be really easy, and is just a matter of pointing the Silverlight app in the right direction.
I'd like to use Silverlight 5 and .Net 4.5 if I can but I don't mind using an older version of either if it makes things easier.
You can just point the connection string to the existing database.
From this answer:
You can point your connection string for authentication to a database that all application can access.
So if you have the default database that .NET creates, you can point your other application to that as well for authentication.

Adding Windows Form Functionality on ASP.NET (VB) Web Application

I have been building a Web Application (ASP.NET, .NET Framework 4, VB, visual studio 2010). To be very brief the application interacts with a database and performs several actions (Insert Delete Select etc..).
I am using several Gridviews, ListBoxes etc and I am not happy with the presentation outcome and the functionality provided by asp.net. In simple words my application looks bad, outdated and unprofessional.
I figured that using Windows Forms that will be incorporated to the ASP app would be a great improvement and solve all of my problems.
I have created a Windows Form Control Library to use the dll created in my app as a user control. I found out that this is not supported in .NET Framework 4 (is this true? or am i doing something wrong?).
Is there any way to make my application have the 'look and feel' of a windows application?
Please note that it is has to be a web app and the clients should not have to download any other application to interact with the server.
Have you checked out the third party controls from other vendors?
I currently use them for rapid development.
http://www.telerik.com/
http://www.infragistics.com/
http://www.devexpress.com/
Anyhow all controls in .net you can change there look and feel using plain CSS.
Try using Silverlight 4, it has all that you need. What u are trying to do is traditional ASP.NET and that's as good as it can get coz its all server side code, but with Silverlight things are totally different, its all client side with specific server interactions. Have a look at the tutorials about how to use Silverlight and WCF RIA services to do what you are trying to do.
Try this link: WCF RIA services and Silverlight
Edit: Silverlight is designed to create stunning web GUIs. Just in case you were wondering what the heck it is.. :)

Windows Forms message box doesn't work in published ASP.Net application

We're developing .Net Application using asp.net and C# and .Net Framework 3.5.
We are using windows form message box in a .Net application.
This windows form works great on the debug mode but once we publish the application this message box won’t work.
We are referencing System.Windows.Form.dll in order to use the message box features.
Kindly advice if we need to register this DLL or follow some configuration steps in order to solve this problem.
Thank in advanced,
Jad
Don't use MessageBox in a web application. It will show up on the server console, there's nobody around to click the OK button. I assume that ASP.NET has some counter-measures against it, given that it is such a serious denial-of-service attack.
If you are using unreferenced classes a project/solution is usually not even compiled.
So probably the problem is in another place. Are you sure that the code that should display the MessageBox is executed?
EDIT: When you develop web applications (ASP.NET), as described by you in comments, you cannot use Winforms MessageBox.
Try showing it with javascript, if you really need it
Response.Write("<script>alert('This a message')</script>");

Building my first ASP application

I've just been tasked with building a web application using ASP (.net) and am looking for some advice on where to start. In a nutshell the application needs to be able to.
Handle user verification / authentication
Handle sessions
Do SOAP messaging
The application is intended to act as a front end for system functions that are accessible via web service calls.
I intend to do a lot of work on the client side using JavaScript and am thinking of using ASP solely as the framework for the 3 items I listed above.
Appreciate any suggestions you may have.
Use Visual Studio 2008 if you can. Its support for Ajax client libraries and javascript intellisense is very good. (Check out the jQuery add in)
ASP.NET has built in Login controls (and the membership services mentioned by ChrisE), and also has Forms Authentication. Try to leverage these existing components and avoid using session to store user specific objects/data.
---session rant
Its sometimes unavoidable, but you should avoid it whenever you can. It incurs a burden on the webserver for each user, and that leads to some very difficult scaling problems. The FormsAuthentication Ticket has a value property that you can store about 4K worth of user data in - try to use that instead.
---End session rant
Try to use a MVC approach (not necessarily an ASP.NET MVC), but at least one that seperates your presentation / view layer from the data / model layer.
Create a default theme and use it. Most sites will need to have multiple themes later, and refactoring that will be a PIA.
If you need SOAP to interact with Non-.NET services then by all means use it. If you are only connecting to .NET services then look into WCF clients and services. They will give you more flexibility.
If you are doing the client work in javascript, then dont use the update panel. It adds lots of overhead.
Get FireFox + FireBug + YSlow, and IE8 (yeah its beta still). They will help you when dealing with the client end of debugging / styling.
Take a look at the rules for website performance, but take these with a grain of salt. They are intended for very large sites, and some of the items may not be applicable (CDN, DNS lookups, Redirects).
WCF for Soap -- I would also suggest picking this up:
alt ASP.NET 3.5 http://ecx.images-amazon.com/images/I/518N8vYWf1L._SL500_AA240_.jpg
This book is in tutorial form -- and Jesse Liberty is a great teacher (as are his co-authors).
ASP.NET provides out of the box authentication/authorization through the SqlMembershipProvider and SqlRoleProvider classes, or you can use the ADMembershipProvider along with a custom RoleProvider to authenticate and authorize against an Active Directory setup.
Session handling is readily provided by ASP.NET as well, through an in-process server, an external StateServer service, or through a connection to SQL Server (and of course, you can provide a custom Session service if you need something different).
As Lou Franco mentioned, WCF provides the framework for the SOAP calls, and will blend in with your ASP.NET application quite handily.
If you are using ASP.NET Web Forms then for handling user authentication/verification I'd recommend ASP.NET Membership services http://msdn.microsoft.com/en-us/library/yh26yfzy.aspx because it does some of the heavy lifting for you and also helps you from making any elementary security mistakes.
This is not directly related to your requirements, but I'd suggest you study the differences between Web Site and Web Application. The sooner the better. Everything will go smoother if you understand how the project is managed.
You can start here: http://www.codersbarn.com/post/2008/06/ASPNET-Web-Site-versus-Web-Application-Project.aspx

Resources