I have a method written in WebForm (means .aspx page) & now
I want to call this method in WebUserControl (means .ascx
page) what should I have to do?
Answer / jp
Use the controls page property and typecast it to the page
class name.
eg:
Page Default.aspx has a control MyControl.ascx
Page Default.aspx.cs has a method MyMethod()
in MyControl.ascx.cs
((Default)(this.Page)).MyMethod();
| Is This Answer Correct ? | 7 Yes | 8 No |
How to implement Authentication and Authorization?
Explain the Session state management options available with ASP.NET?
What is the default timeout for a cookie?
How do you use css in asp.net?
How do you use viewstate?
Which method has beenintroduced in asp.net 4.0 to redirect a page permanently?
What are html helpers in asp.net?
How use Xml data in ASP.net?
What are the 3 levels at which content pages can be attached to Master Page?
What is the method used to load generated dataset with data on the DataAdapter control ?
What is Difference between Callbacks and Postback in ASP.NET?
What is %20 in a url?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)