Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / December 2005

Tip: Looking for answers? Try searching our database.

Help needed, Call a save event from main page ??

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jesper_lofgren@yahoo.se - 21 Dec 2005 10:25 GMT
Hi,

I have a main page that contians some webcontrols.

On the main page i have a asp:button id="Save".
The thing is that i want to trigger a save event in all webcontrols
when i cklick on the asp:button on the main page.

Anyone have a idea how i can do this ?

Thanks
// Jeppe
Ignacio Machin ( .NET/ C# MVP ) - 21 Dec 2005 13:46 GMT
Hi,

> On the main page i have a asp:button id="Save".
> The thing is that i want to trigger a save event in all webcontrols
> when i cklick on the asp:button on the main page.

There is no such a thing as a "save" operation in the asp.net controls, you
can handle the click event of the save button and collect the info from the
controls and save it accordingly.

Signature

Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

jesper_lofgren@yahoo.se - 21 Dec 2005 15:17 GMT
Yea thats what i mean, but how do i collect the click event from the
(sub) controls on the main page ?

Thanks
Jeppe
Ignacio Machin ( .NET/ C# MVP ) - 21 Dec 2005 16:07 GMT
easy:

In the aspx page:

<asp:Button Runat="server" ID="MainBTN" OnClick="SortClicked"
Text="Accident" ></asp:Button>

in the cs file:

SortClicked( object sender, EventArgs e )

Signature

Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

> Yea thats what i mean, but how do i collect the click event from the
> (sub) controls on the main page ?
>
> Thanks
> Jeppe
jesper_lofgren@yahoo.se - 21 Dec 2005 21:10 GMT
Thanks, but, i wanna catch the event in the webcontrols that are
included in the aspx page not in the codebehindfile for the aspx (main
page).
Ignacio Machin ( .NET/ C# MVP ) - 22 Dec 2005 14:38 GMT
Hi,

> Thanks, but, i wanna catch the event in the webcontrols that are
> included in the aspx page not in the codebehindfile for the aspx (main
> page).

not clear what you mean, the codebehind is where you should put all your
code to handle the interactions with the page, the page (what you declare in
the .aspx file) will be compiled at runtime as a class which inherit from
the one you declare in the codebehind ( .cs) file, so it will have access to
it.

Signature

Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.