views:

528

answers:

3

Our web page is only available internally in our company and we am very intrested in being able to offer interactive .net usercontrols on our departments website in the .Net 2.0 enviorment. I have been successful with embeding the object as so:

<object id="Object1" classid="http:EmbedTest1.dll#EmbedTest1.UserControl1" 
        width="400" height="400">
    <param name="TestStr" value="Test Param String" />
</object>

The control worked just fine and the value was passed to the control without issue. But I had a problem with passing subsequent values back to the embedded control

attempt to Recieve event from control:

attempt to update control:

<script type="text/javascript">
   function UpdateStr()
   {
      Object1.Text = "update string";
   }
</script>

Reference:
http://www.15seconds.com/issue/030610.htm
http://windowsclient.net/articles/iesourcing.aspx

Questions:

  1. Is this technology outdated? - if so is there a replacement
  2. Should I just work with action script instead of trying this?
  3. I have got this to partially work and I was attempting to connect to a webservice that I have running and I got many security exceptions...I didn't get the same exceptions when I used action scipt2 in the same manner?

(side note : - how do i paste html script examples?)

Thanks.
Brad

+1  A: 

If the things that you are doing with the Windows Controls could be done with ASP.NET web controls instead, I recommend that you consider switching. You'll have much better control over the exchange of info from the client to the server.

DavGarcia
+1  A: 

1, 2) Yes it is outdated. If you want to work in .NET (and you're bent on having a control rather than an ASP.NET-style page/site), give Silverlight a try instead.

3) .NET code running in the browser is subject to very strict security controls (can't call back to a web site it didn't come from, for example).

DannySmurf
+2  A: 
  1. Not out-dated so much as rarely used, and IE-only. If you want web-like deployment for desktop apps, use ClickOnce. If you want C# code that runs in the browser without security issues, use Silverlight. You could also look at XBAPs, which are sandboxed WPF apps that run in the browser, works on IE and Firefox, but requires the full .NET to be installed client-side, whereas Silverlight does not have this problem. Bottom line: look at Silverlight.

  2. That's certainly an option. If you're more familiar with the Microsoft stack, you should try Silverlight, where you can code C# against a subset of the .NET framework right inside the browser.

  3. We've used .NET controls in web pages internally and had a wide variety of strange issues, mostly related to scripting or security. Hard to determine the problem without more information.

p.s. write all code examples using the <pre> tags. There's a "code sample" button on the toolbar.

Judah Himango
thanks. I have never used silverlight is it framework version dependant?
Brad
Silveright has it's own tiny version of the .NET framework. It's small (less than 5MB) and installs in about 20 seconds. See http://silverlight.net/
Judah Himango