Calling function from one webpage to another
-
How can in WebForm1 the function in WebForm2? i try WebForm2. and look up for other overloads, but i get view the function. Any one can help. A big thanks!
-
How can in WebForm1 the function in WebForm2? i try WebForm2. and look up for other overloads, but i get view the function. Any one can help. A big thanks!
I am not shure I understand the question corretly. But in asp.net pages, a Form is loaded(Form1 in your example), when user requests this page. So there will be no instance of Form2. If you have to call methods from Form2 I think you will have to use static methods I hope this helps!
-
How can in WebForm1 the function in WebForm2? i try WebForm2. and look up for other overloads, but i get view the function. Any one can help. A big thanks!
doesnt sound like the best idea, you can however put the functions in a new util class in the same namespace or namespace.Util and inlcude that in your using statements(if you use the .util one) and access that functions that way, it makes life easier 6 months down the road when you have to change a method in form 2 you wont have to worry about where else it might be called at, but you know the util class would be used in other places so debuging may be easier for you. and if for some reason you change what form 2 does or replace your function and delete it, you wont accidently break another form you werent changing, this happened to a dev we had working here a few times then he finally took my advice after he couldnt figure out what was going on, now the code behind pages are clearer, and it forced him to start thinking about how to do things generically instead of copying the same function to 15 different files... hope it helps.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
-
How can in WebForm1 the function in WebForm2? i try WebForm2. and look up for other overloads, but i get view the function. Any one can help. A big thanks!
ewin wrote:
How can in WebForm1 the function in WebForm2?
This is not the asp.net forum , please put it over ther. Try to create separete class for accessing same function
Best Regards ----------------- Abhijit Jana Check Out My Latest Article Java.NET : Integration of Java and .NET[^] "Success is Journey it's not a destination"