.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old August 5th, 2003, 01:59 PM
admcdona admcdona is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 20 admcdona User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Windows .NET controls in ASP.NET???

The history:

My company has recently decided to switch from ASP to ASP.NET for our application. Our current method of developement has been to create ActiveX controls and embed them on ASP pages (obviously using the OBJECT tag). This gave our web application the same look and feel of a windows app.

The Question:

Can anybody tell me how to embed a VB.NET Windows Control on an ASP.NET page?

Any help would be greatly appreciated!

Thx,
-Aaron

Reply With Quote
  #2  
Old August 7th, 2003, 10:37 AM
dcgartn dcgartn is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: chicagoland
Posts: 4 dcgartn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
With .Net, this is very simple.

First, create your User Control as you would normally, and compile it as a dll.

Place the dll on your server, and in the html page you want to embed the control, add the following html:

<object id="YourControl"
classid="http:YourControl.dll#NamespaceName.Classname"
height="500" width="500" >
</object>

..You will need to change the values above so they correspond to yuor control.

Here are some links that discuss this in further detail:

URL
URL
URL

Hope I could help,
Dan

Reply With Quote
  #3  
Old August 7th, 2003, 11:08 AM
admcdona admcdona is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 20 admcdona User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Awesome! That's exactly what I needed. Thanks Dan!

-Aaron

Reply With Quote
  #4  
Old August 26th, 2003, 03:37 PM
jfrost10 jfrost10 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 2 jfrost10 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Security?

Hey guys,

Did you have any issues with security with downloading the controls?

I have a control that has to access a com port on the client pc (for a card reader). But I keep getting security exceptions.

Any thoughts on how to work around it? I've already added my site to IE's trusted sites, and made sure that my virtual directory settings are set to scripts only (not scripts and exe's).

Any thoughts?

Thanks,

D'Arcy

Reply With Quote
  #5  
Old August 26th, 2003, 03:43 PM
admcdona admcdona is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 20 admcdona User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Yes, after you add the site to your trusted sites in IE, you need to change your security level for .NET code. I actually had to set it to Full Trust to get things to work for me....but it is working. You can adjust this setting by going to Control Panel - Administrative Tools - Microsoft .NET Framework Wizards 1.1 - Adjust .NET Security. Hopefully this helps!

-Aaron

Reply With Quote
  #6  
Old August 26th, 2003, 04:16 PM
jfrost10 jfrost10 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 2 jfrost10 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Word!

Aaron, thank you so much!

Totally did the trick with the security permissions, and it works like a charm!

By chance have you done anything like postback the page when information has been entered into the control?

I have a textbox in my usercontrol, and when it has text in it I need to postback to the server, but not sure how (I'm guessing some sort of javascript probably, eh?)

Thanks!

D'Arcy

Reply With Quote
  #7  
Old August 26th, 2003, 05:03 PM
admcdona admcdona is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 20 admcdona User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
No problem! Glad I could finally do SOME good in this world...nobody can call me a menace to society anymore right?!

About the postback...I'm sure you could probably get the results you want by using Javascript. I'm not sure exactly how though. If you're just hitting the server to update a DB with the value from your textbox, you may want to do what I did and just use ASP.NET Webservices straight from the Windows Control. If you're posting back to the server to send the textbox value through some business logic, then I guess you'll have to figure out how to do that via javascript or some other method.

(BTW...if you do figure out how to do that via javascript...I'd love to have that info passed on to me!)

-Aaron

Reply With Quote
  #8  
Old August 30th, 2004, 07:18 AM
yelizt yelizt is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 1 yelizt User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
How can I pass parameters from asp.net page to windows user control?
my windows user control has a public property called branch and I have to fill this
property from asp.net page. I tried param tag as in the following but it didn't worked.


<OBJECT id="Reporter1" classid="http:ReportService.dll#ReportService.Reporter" VIEWASTEXT>
<PARAM NAME="branch" VALUE="sss">
</OBJECT>

Reply With Quote
  #9  
Old September 13th, 2004, 01:07 PM
admcdona admcdona is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 20 admcdona User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
You pass parameters from the .NET page to the windows user control by using javascript or vbscript on the page. For example - say your Reporter1 has a public function called InitReporter, and InitReporter takes 1 param called branch. You would do the following:

Code:
<OBJECT id="Reporter1" classid="http:ReportService.dll#ReportService.Reporter" VIEWASTEXT></OBJECT>

<script language=vbscript>
Sub StartReporter
     Reporter1.InitReporter BranchParamValueHere
End Sub

StartReporter
</script>


Quote:
Originally Posted by yelizt
How can I pass parameters from asp.net page to windows user control?
my windows user control has a public property called branch and I have to fill this
property from asp.net page. I tried param tag as in the following but it didn't worked.


<OBJECT id="Reporter1" classid="http:ReportService.dll#ReportService.Reporter" VIEWASTEXT>
<PARAM NAME="branch" VALUE="sss">
</OBJECT>

Reply With Quote
  #10  
Old July 31st, 2005, 07:46 PM
sumithpdd sumithpdd is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 1 sumithpdd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 23 sec
Reputation Power: 0
card reader

Hey i am also trying to do the same... did you finish creating activex for cardreader.

Reply With Quote
  #11  
Old August 1st, 2005, 06:53 PM
Amunike Amunike is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2005
Posts: 2 Amunike User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 26 sec
Reputation Power: 0
looking for activeX sample code in vb.net

Hello Aaron

I came across this post of yours while searching the net for information. I;m also trying to develop activeX controls in vb.net but I don't have any clue. Would you be kind enough to share that information with me? a detailled step by step or preferably a working code sample?

I would be forever gratefull.

thanks

Amunike

Quote:
Originally Posted by admcdona
The history:

My company has recently decided to switch from ASP to ASP.NET for our application. Our current method of developement has been to create ActiveX controls and embed them on ASP pages (obviously using the OBJECT tag). This gave our web application the same look and feel of a windows app.

The Question:

Can anybody tell me how to embed a VB.NET Windows Control on an ASP.NET page?

Any help would be greatly appreciated!

Thx,
-Aaron

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > Windows .NET controls in ASP.NET???


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap