windows form controls in place of web controls in .net 2.0

G

Guest

I saw a sample app at the VS live conference in San Francisco this year, they
had a gridview control on a web form, but when .net 2.0 was detected on the
PC it actually rendered a .net form control in place of the web control.

I am playing around with beta 2 and trying to replicate that behavior. Does
anyone know how to do this????

Any help would be appreciated!!!
Thanks!
 
S

Steve C. Orr [MVP, MCSD]

I haven't seen the presentation you saw, but...
You can check the CLR version with this property:
Request.Browser.ClrVersion.Major

You can embed a windows forms control in an ASP.NET form with HTML like
this:


<OBJECT id="MyControl1" height="20" width="192"

classid="http:MyCustom.dll#MyNamespace.MyClassName">

<PARAM NAME="Backcolor" VALUE="blue">

You have an unsupported browser.

</OBJECT>



Here's more info:

http://samples.gotdotnet.com/quickstart/winforms/doc/WinFormsIeSourcing.aspx
 
B

Bruce Barker

the simple method is to test the agent string (or browsercaps) for .net
support. then render the page different. i belive this will fail if the user
turns active/x support off on the browser. the safe method, is to write a
sniffer page that detects .net supported by creating a small control, and
returning the success to the server.

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top