index > ClickOnce and Setup & Deployment Projects > Host WinForm UserControl in ASP.NET 2.0

Host WinForm UserControl in ASP.NET 2.0

I use C# and Visual Studio.NET 2005 Beta to develop a WinForm UserControl and host it in ASP.NET 2.0. I want to send a string via the user control's properity by using <param name="WebSitePath" value="strWebSitePath" /> in object tag. But it doesn't work. Please tell me how to solve the problem. Thanks!
charlieucla
hi again !

I am back after a short break!!!

I have seen your's problem. So the solution i am discussing you i have tested in VB.NET 2003 but i think it will work in VS.NET 2005 also

So here it is: I am giving you the vb.net Code Translate it to c# yourself

In you Windows Form UserControl Class Create one Public Property called

Public Class MyUserControl 
                Inherits System.Windows.Forms.UserControl

   Public Property getString ( ByVal str As String ) As String
      Get
           return  str
      End Get
      Set ( ByVal value As String )
          str = value
      End Set
   End Property

End Class

-------------------------------------------------------------------------------

Now go to the asp.net page where you have used the userControl and write the following javascript in that page

<script language="javascript">

   MyControl.getString = "This is a sample String";

   document.write ( MyControl.getString );

</script>

where

<html>
  <object id="MyControl" classid="MyControl.dll#MyNameSpace" height=200
             width=300>
  </object>
</html>
------------------------------------------------------------------------------

In this way you can set the Public Properties of UserControl  using javascript in the page.



Please tell me whether this thing works in VS.NET 2005.

Please feel free to contact me regarding any .NET Control hosting Problem(s) at
any of the following ids

ErSehmi@yahoo.com
ErSehmi@hotmail.com
ErSehmi@gmail.com
ErSehmi@msn.com
  
ErSehmi
reply 2

You can use google to search for other answers

 

More Articles

• RemovePreviousVersions & GAC installation
• check database structure when update
• Ugh... Hosting UserControls in IE...
• publish.html is not sent to the server
• Deploying an optional desktop shortcut
• datadirectory and vb .net
• Hosting ClickOne deployment on non-.NET 2.0 server
• Install from CD
• How can I get the Virtual Dir form the Installation Address dialo...
• ClickOnce publish failes when project has reference to assembly d...
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• deployment of a .NET application
• How to make an application start automat
• Deploy Content XML Files to TargetDir no
• HKEY_CURRENT_USER\Software\Microsoft\Win
• MSM install location
• Beta2 Deployment error
• Major Smart Client Deployment issues
• Invalid Operation Exception while instal
• the plot thickens!
• Deploying a Win Form via Web Server
• Smart Client Installation Problem
• ClickOnce Beta 2
• Clickonce updates
• Web Seup projects and port numbers
• Publishing a windows application to a sh

Hot Articles

• how to consume a web service throgh dyna
• software Update using Updater component
• need help in creating DLL with resources
• Embedded Windows Forms Controls in IE on
• How to add a file to a clickonce deploym
• VS.Net 2005 Beta 2 - Installer Project -
• Install clickonce application don't requ
• Application Deployment (Setup)
• Excluding files from setup project (VS20
• ClickOnce and Team Foundation
• setup error
• No-Touch/Smart Client Offline Capability
• Major flaw when deploying to multiple cl
• publishversion vs productversion
• Using the clickonce 'datadirectory' when

Recommend Articles

• Registering .NET Windows Forms User Cont
• InvalidDeploymentException on some clients
• Delete files on target machine from a se
• Multiple download of the same assembly
• Error: Unable to activate the application
• Unable to update the dependencies of the
• Dll hell is it really gone ....... or ju
• Add a Form in a Deployment Project
• Published application file list is incom
• clickonce async wait
• Using command line with ClickOnce
• Passing arguments to DOTNET's href'ed Ex
• Control in IE interferes with Form Post
• ClickOne with ODP.Net
• Problem with ClickOnce and mandatory pro