Click here to Skip to main content
15,913,115 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
i have two webform called webform1 and webform2. have to create obj for webform2'class name

webfrom1 is having class and webform2 is having class. right?

let us consider. webform1 is having class called webclass1 and webform2 is having class called webclass2.

so, now i am in webform2.
C#
class webclass2

{

// here i want to create obj for webform1' class name like follows

webclass1 obj=new webclass1();

}
Posted
Updated 8-Aug-13 1:32am
v3
Comments
Ambesha 8-Aug-13 7:44am    
What is the issue you are getting, if your class is in same namespace then you can call it in the same way, please explain if you are getting any error.
ZurdoDev 8-Aug-13 9:38am    
Please explain why. Webforms are forms and you likely just need to create a new class if you want to share things between the forms. Creating a new instance of the form in code is not a food idea. Forms are designed to be delivered to a client, not generated in code.
Sergey Alexandrovich Kryukov 8-Aug-13 12:36pm    
"Webform having class..." This is already... who knows what?... What is "having"? What is "in a webform"? Why object of one "webclass" in another one? To me, it sounds like some gibberish. Do you know how ASP.NET works in principle?
—SA
sumit_kapadia 9-Aug-13 2:13am    
Yes man you can do any thing with that damm classes...

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