|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
Awesome! That's exactly what I needed. Thanks Dan!
-Aaron |
|
#4
|
|||
|
|||
|
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 |
|
#5
|
|||
|
|||
|
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 |
|
#6
|
|||
|
|||
|
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 |
|
#7
|
|||
|
|||
|
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 |
|
#8
|
|||
|
|||
|
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> |
|
#9
|
|||
|
|||
|
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:
|
|
#10
|
|||
|
|||
|
card reader
Hey i am also trying to do the same... did you finish creating activex for cardreader.
|
|
#11
|
|||
|
|||
|
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:
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > .NET Development > Windows .NET controls in ASP.NET??? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|