Question

Status:Closed    Asked:Sep 04, 2008 - 04:53 AM

how to call function in .aspx.cs from ascx.cs

i have function in .ascx.cs i want to use this function in page.aspx
thank u


Add New Comment


 
Do you have the same question? Follow this Question
 

Answers

You can not access a function from usercontorl class unless you have instance of it in your page and the function is public. e.g. (usercontorl1.function1())

otherwise, you should have that function in a class inside AppCode


Add New Comment


 

Mar 26, 2009 - 03:54 AM

0
0
Report it

The question looks to be abandoned by the user who asked it. If no action is taken within 2 days, a Quomon Moderator will consider closing the question and distributing the points.

The Quomon Team


Add New Comment


 

Apr 17, 2009 - 06:24 AM

0
0
Report it

WebUserControl1.Test("a", "b");

here Test is the function on the ascx.cs page

and WebUserControl1 is the ascx page which is used in the aspx page


Add New Comment


 

Aug 12, 2009 - 02:15 AM

0
0
Report it

I don't see any reason why you want to do this. But if you want you can use events and delegates.


Add New Comment


 

Oct 22, 2009 - 03:35 AM

0
0
Report it


create that function "public" and then you can use that function like this
in ascx.cs
puplic void somefunction(arguments)
{
// your code here
}

in aspx.cs

controlObject.somefunction(arguments);


Add New Comment


 

Aug 10, 2010 - 06:59 AM

0
0
Report it

WebUserControl1.Test("a", "b");


Add New Comment


 

Apr 19, 2011 - 09:12 PM

0
0
Report it

You need have that function in a class inside AppCode
http://www.holeesoft.com/blu-ray-ripp...


Add New Comment


 

Apr 24, 2011 - 08:24 PM

0
0
Report it
avatar

nik

Create separate class file and add your function in this class and refer this class in your both .aspx.cs and .ascx.cs page and use this common method anywhere you want.


Add New Comment


 

Jun 09, 2012 - 11:22 PM

0
0
Report it


OTHER QUESTIONS NEEDING ANSWERS

Asus Eee PC 1025 Battery
Can you refer step by step study material for creating Wordpress blog?
How do I start a blog?
Is there a good online tutorial for learning Wordpress?
Best open source theme for wordpress with photobloging option?
Do you know any great free webhost with cPanel that will run WordPress?
Login   |   Register

Ask a question on Quomon


ajapprog
54
3831
0 question
1 question
Knowledgeable, Contributor

 | Direct a question to this member
Mustafa
540
210
4 questions
0 question
Knowledgeable, Contributor

 | Direct a question to this member
admin
9486
Not ranked
799 questions
0 question
Maestro, Hardcore, Experienced, Knowledgeable, Contributor

 | Direct a question to this member
vikasstyagi
510
894
1 question
0 question
Knowledgeable, Contributor

 | Direct a question to this member
dontnetkid
540
216
4 questions
0 question
Knowledgeable, Contributor

 | Direct a question to this member
sunilverma16
510
999
1 question
0 question
Knowledgeable, Contributor

 | Direct a question to this member
lnj888
560
144
6 questions
0 question
Knowledgeable, Contributor

 | Direct a question to this member
nik
520
395
2 questions
0 question
Knowledgeable, Contributor

 | Direct a question to this member
wommy
101
3178
5 questions
0 question

 | Direct a question to this member
barrybart
149
3159
7 questions
0 question

 | Direct a question to this member
hiphop
121
3173
6 questions
0 question

 | Direct a question to this member
Urypomuer
149
3160
9 questions
0 question

 | Direct a question to this member