473,320 Members | 1,940 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Call page method from user control in C#?

I have a menu user control that navigates through 4 or 5 web forms. The
control basically has "tabs" that are hyperlinks to each page.

On each page a have a validation method that validates all page input.

How can I call this method from the user control when the a tab/hyperlink is
selected?

Do I create a delegate on web form? If so, any pointers. Is there an
easier way?

Regards,

Tulio
Nov 18 '05 #1
2 14235
"Tulio Quinones" <tu************@cmtww.nospam.com> wrote in message
news:O0*************@tk2msftngp13.phx.gbl...
I have a menu user control that navigates through 4 or 5 web forms. The
control basically has "tabs" that are hyperlinks to each page.

On each page a have a validation method that validates all page input.

How can I call this method from the user control when the a tab/hyperlink is selected?

Do I create a delegate on web form? If so, any pointers. Is there an
easier way?


Would Page.Validate suit your needs?
--
John Saunders
johnwsaundersiii at hotmail
Nov 18 '05 #2
Look up IPostBackEventHandler in the framework documentation. The
documentation shows how to implement the interface and create an event in
your control.

Then, in the web form, create an event handler for your custom event, and
from that event handler, call your validation method. It's really easier
than it sounds.

Good luck,

Dale Preston
MCAD, MCSE, MCDBA

"Tulio Quinones" <tu************@cmtww.nospam.com> wrote in message
news:O0*************@tk2msftngp13.phx.gbl...
I have a menu user control that navigates through 4 or 5 web forms. The
control basically has "tabs" that are hyperlinks to each page.

On each page a have a validation method that validates all page input.

How can I call this method from the user control when the a tab/hyperlink is selected?

Do I create a delegate on web form? If so, any pointers. Is there an
easier way?

Regards,

Tulio

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Simon | last post by:
I have a form, "Form1" that I would normally step through using Control frm = FindControl("Form1"); foreach(Control ctrl in frm.Controls) But now I have this page as a user control loaded by a...
1
by: Dan | last post by:
I have an asp.net page default.aspx with a user control and a placeholder control. <html> <body> <form id="myform" method="post" runat="server" /> <PageHeader:Header id="header1"...
2
by: Alex Wagner | last post by:
I've been trying to gain access to the container page from within a user control. Case in point: From within the user control I need to call a method in the business layer that needs a reference...
2
by: Raed Sawalha | last post by:
I have a aspx page with one user control , in the user control i have hidden field (name hdnSaved) runat server wrapped in property like following :- in documentview.ascx public string...
13
by: Michael | last post by:
I have setup a public variable in the Master Page "code-behind-file". Now I would like to set that value from the UserControl, but I can't seem to find a way to do this. Does anyone have any ideas?...
1
by: Congero | last post by:
I have a user control embedded in a page. When the user clicks a link button on the user control, I would like to execute a method on the page and pass it two parameters. How can I accomplish...
3
by: Mukesh | last post by:
Hi all I have to transfer a dataset and a string from a webform to a user control on the page without using viewstate or session or cookies . properties method is not working properly. if...
4
by: Eric | last post by:
I got a particular problem in visual studio 2005 There's a user control on page and I want to meka a cast like this MyPage mp=(MyPage)this.Page; Error is : cannot cast from...
2
by: Rissoman | last post by:
I have two user controls on a master page. I can easily bubble up an event on usercontrol 1 from a click event to the page.aspx, than then calls a method on the masterpage, but this causes the...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.