Click here to Skip to main content
15,905,427 members
Please Sign up or sign in to vote.
1.80/5 (2 votes)
See more:
i have created windows user control and i am using it on web page, but when i use this line on web page it gives me error as a control type was not specified.

<object id="Object1" classid="http:WindowsFormsControlLibrary1.dll#WindowsFormsControlLibrary1.UserControl1"
height="70" width="350"/>

can u please help??
Posted
Updated 29-Jan-14 18:16pm
v2
Comments
Kornfeld Eliyahu Peter 28-Jan-14 5:11am    
Are you trying to put a windows for control on a web page?
sumit kausalye 30-Jan-14 0:10am    
yes sir.
ZurdoDev 29-Jan-14 21:47pm    
Sure, what's the problem?
sumit kausalye 30-Jan-14 0:14am    
i have created windows user control and i am using it on web page, but when i use this <object id="Object1" classid="http:WindowsFormsControlLibrary1.dll#WindowsFormsControlLibrary1.UserControl1"
height="70" width="350" VIEWASTEXT/>

it gives me error as a control type was not specified.
ZurdoDev 30-Jan-14 7:47am    
Sorry, but it is a really bad idea to use a windows control in a web app. They are 2 very, very different things. See the solutions below.

Quote:
i have created windows user control and i am using it on web page
You can't. Instead create a Web UserControl and include that in Web Page. You are mixing Windows and Web App, which is not possible.

Refer - ASP.NET User Controls[^].
 
Share this answer
 
Comments
Karthik_Mahalingam 30-Jan-14 0:48am    
5!! rightly said.
Thanks Karthik. :)
 
Share this answer
 
v2
Comments
Kornfeld Eliyahu Peter 30-Jan-14 1:08am    
It's somehow misleading...It's true that you can do this in a very awkward way, but IMHO you MUST point out all the pitfalls of such a solution...for instance it's works only on specific browsers on specific OS. A lot of security issues accompanied with various popup messages on the client...
JoCodes 30-Jan-14 2:38am    
Kornfeld , I agree that its an awkward way of doing it.But if OP asked as a suggestion should I would have stated that. Also, Tadit has suggested to use WebUserControl which was the right one.
sumit kausalye 30-Jan-14 3:43am    
ok sir. thank u.
JoCodes 30-Jan-14 3:51am    
Welcome
JoCodes 1-Feb-14 6:30am    
Tried?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900