473,383 Members | 1,859 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,383 software developers and data experts.

Customer Rendered Web Controls - Page.GetPostBackEventReference vs IPostBackEventHandler

I still have a few questions here. Ive been following some examples in a
Microsoft Press book on this and have produced a small calculator control
which I have written most of the code for.

My quandy relates to the Postback.

I have rendered my buttons with OnClick="javascript:" &
Page.GetPostBackEventReference(ControID) which when rendered does a
_doPostback('ControlID,'') javascript call and post the page back.

The event handlers for the click events on these buttons fire and in turn
raise a control event to tell the containing page that the event has fired
and for this I pass a derived EventArgs which carries the Button ID and
value etc in order to communicate this information.

My Question is mainly centred aournd the IPostBackEventHandler. I have
implemented this and have also tried it without, and I see no difference. Im
convinced that Ive missed the point here, but I cant see it.

Can anyone illuminate?
--
Best Regards

The Inimitable Mr Newbie º¿º
Nov 19 '05 #1
1 3443
Actually I have taken this forward a little since my post, but Im still not
entirely sure which approach is the best.

If you render your Custome Control Buttons with a Javascript onClick to
Page.GetPostBackEventReference(me), then the IPostbackEventHandler's
RaisePostbackEvent will get called. However, if you want the underlying
controls ( Buttons ) to fire their own Click Handler then you need to render
them with a Javascript Page.GetPostBackEventReference(CONTROLID).

In the latter case, this RaisePostbackEvent never gets called.
I think that there is more than one way to skin a cat, but Im not sure which
one is approved ?, any ideas on approach would be welcome.
-
Best Regards

The Inimitable Mr Newbie º¿º

---------------------------------------------------------------
"Mr Newbie" <he**@now.com> wrote in message
news:e8**************@tk2msftngp13.phx.gbl...
I still have a few questions here. Ive been following some examples in a
Microsoft Press book on this and have produced a small calculator control
which I have written most of the code for.

My quandy relates to the Postback.

I have rendered my buttons with OnClick="javascript:" &
Page.GetPostBackEventReference(ControID) which when rendered does a
_doPostback('ControlID,'') javascript call and post the page back.

The event handlers for the click events on these buttons fire and in turn
raise a control event to tell the containing page that the event has fired
and for this I pass a derived EventArgs which carries the Button ID and
value etc in order to communicate this information.

My Question is mainly centred aournd the IPostBackEventHandler. I have
implemented this and have also tried it without, and I see no difference.
Im convinced that Ive missed the point here, but I cant see it.

Can anyone illuminate?
--
Best Regards

The Inimitable Mr Newbie º¿º

Nov 19 '05 #2

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

Similar topics

0
by: dominosly | last post by:
Okay, this is a rather complicated problem, so here is the short of it: I am using a custom designed user control that simply writes out a plain old html submit button to the page. When the...
1
by: Lamont Adams | last post by:
Hi all, I've created numerous custom controls of varying complexity, but I've been on this problem for a day and a half, and I can't figure this mystery out. I hope one of you kind folks can...
4
by: Sam Martin | last post by:
hi, I'm making a custom control that is rendered implementing the IPostBackEventHandler interface, and have got it working fine for a single submit button, but how do i pass arguments from the...
5
by: Psych971 | last post by:
Hi, I'm wondering how I can generate a postback using javascript on a page that does not have any controls with the auto-postback property set to true. I know I can just use the submit() function...
2
by: magister | last post by:
Hello, I have a asp.net page with a form with 15 textboxes and a couple of dropdownlists....I want to know if their is a way (...serverside please...) of checking if any change has been made to...
2
by: The Crow | last post by:
i want to raise an event on the server with a javascript call on the client. i found a solution but i think its not so elegant. the solution is: i call __doPostBack("RefreshPage", ""); from...
1
by: SlimFlem | last post by:
I hope this makes sense. Here is what I am attempting. I have an inital generic aspx page that has one custom tag: <web:site id=webSite runat=server/> When this control evaluates, it will...
3
by: Smokey Grindel | last post by:
I have a page with no ASP.NET controls on it put I have links that use the __doPostBack('','') javascript method on it, it wont work, oh course I know why, the script isnt registered.. because if...
12
by: Michael Lang | last post by:
I'm adding checkbox controls to a panel in a post back, I then have a second post back in which I attempt to process the checkbox controls however they seem to have disappeared off the panel. The...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.