VB User Control for the WEB

AndyDale

Member
Joined
Nov 13, 2007
Messages
23
Location
Warwick, UK
Programming Experience
10+
Hi, I'm trying to create a Client Side User Control in VB.NET that can be used in the IE7 browser and can read the current UserName and ComputerName and display it on the WEB page.

I've created a User Control called MyDetails with two labels and added the following code:
VB.NET:
lblComputerName.Text = My.Computer.Name
lblUserName.Text = My.User.Name
Then I built the control as MyDetails.dll

I then created a Web Application Default.htm and added the following code to the body tag.

HTML:
    <div>
        This is my user control.
        <object id="MyDetails" classid="http:MyDetails.dll#MyDetails.Details" VIEWASTEXT>
        </object>
    </div>
I copied the MyDetails.dll into the same directory as Default.htm

When I ran the Default.htm the browser displayed
This is my user control.
and nothing else. Where have I gone wrong?

If I replace the
VB.NET:
lblComputerName.Text = My.Computer.Name
lblUserName.Text = My.User.Name

with

VB.NET:
lblComputerName.Text = "My Server"
lblUserName.Text = "My User Name"

Then when I ran the Default.htm again the browser displayed
This is my user control.
My Server
My User Name
So I know the code is sort of working.

I'd appreciate any helpful suggestions:confused:
 
Sorry and confused VB not ASP

Please make the effort to post in the most suitable forum. Moved.

Erm. Sorry and confused. I didn't intend using ASP to do this and it is a Client Side VB Application (NO ASP.NET) in a WEB form. Please could you check (with your colleagues) that you have moved me to the correct Forum else I'm not going to find a solution.:confused:
 
I'm trying to create a User Control using VB (VS2005 .NET Framework 2) that displays data in a Web page (browser IE7). The Application should run on the Client Side not on the web server. How do I get the application to read & display the current User & Computer name?
 
User Control reading remote data

I’m trying to create a control that will read and display a value on a web page (IE7) read from a text file hosted on a another PC.

Some people say VB.NET others ASP.NET and others AJAX. I’m primarily a VB6 developer moving into VB.NET and would like a pointer in the right direction.

The value should be read from a text file hosted on another PC once the web page is displayed.
The value will then be re-read and updated at a configurable interval.
The control should read the interval from a parameter set in html.
Many of these controls can be placed on a single webpage.
The entire webpage should not be refreshed only the text regions displaying the value.

I wrote an ActiveX User Control in VB6 many years ago that did this but now I require a .NET solution.
 
I'm trying to create a VB User Control that can be used in a WEB page particularly IE7. The control is to be used Client Side and read the Computer & User Name. Can this be done?

I’ve created a VB User Control and tested it in a Windows Form and all is OK but when I embed it into a WEB page it fails. I have strongly signed the app and added it the Assembly Cache using the .NET Framework 2 Configuration tool. Still with no luck. Strangely a simple VB UC that doesn’t try to read Computer or User Name works fine.

I've created many VB6 ActiveX user controls that can be used to read data in this way when embedded in a WEB page but now need a .NET solution.

I'd appreciate any help with this problem.:eek:
 
I'm trying to create a VB User Control that can be used in a WEB page particularly IE7. The control is to be used Client Side and read the Computer & User Name. Can this be done?

I’ve created a VB User Control and tested it in a Windows Form and all is OK but when I embed it into a WEB page it fails. I have strongly signed the app and added it the Assembly Cache using the .NET Framework 2 Configuration tool. Still with no luck. Strangely a simple VB UC that doesn’t try to read Computer or User Name works fine.

I've created many VB6 ActiveX user controls that can be used to read data in this way when embedded in a WEB page but now need a .NET solution.

I'd appreciate any help with this problem. :eek:
 
User Control reading remote data

I’m trying to create a control that will read and display a value on a web page (IE7) read from an application hosted on a another PC.

Some people say VB.NET others ASP.NET and others AJAX. I’m primarily a VB6 developer moving into VB.NET and would like a pointer in the right direction.

The value should be read from a application hosted on another PC once the web page is displayed.
The value will then be re-read and updated at a configurable interval.
The control should read the interval from a parameter set in html.
Many of these controls can be placed on a single webpage.
The entire webpage should not be refreshed only the text regions displaying the value.

Can remoting be used on a Client Side VB User Control?

I wrote an ActiveX User Control in VB6 many years ago that did this but now I require a .NET solution.:eek:
 
Back
Top