473,624 Members | 2,564 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Rendered web control using IPostBackEventH andler.RaisePos tBackEvent

hi,

I'm making a custom control that is rendered implementing the
IPostBackEventH andler interface, and have got it working fine for a single
submit button, but how do i pass arguments from the HTML page back to the
server, e.g. identify which button has been pressed.

At the moment i can only cause a postback by using a submit button, are
there any other ways? - i.e. can a do a manual javascript,
document.forms[0].submit() ?

Any help / pointer welcome
TIA
Sam Martin
Nov 18 '05 #1
4 3467
When you are rendering your button, what are you setting the client onclick
event to?

You should be setting the onclick to the Page.GetPostBac kClientEvent method.

I usually pass it this and the args.

IE

this.Attributes["onclick"] = Page.GetPostBac kClientEvent( this, "args" );

The "args" will be passed to your RaisePostBackEv ent method and you could
process it then.

bill

"Sam Martin" <sa*********@ya hoo.co.uk> wrote in message
news:Ol******** ******@TK2MSFTN GP09.phx.gbl...
hi,

I'm making a custom control that is rendered implementing the
IPostBackEventH andler interface, and have got it working fine for a single
submit button, but how do i pass arguments from the HTML page back to the
server, e.g. identify which button has been pressed.

At the moment i can only cause a postback by using a submit button, are
there any other ways? - i.e. can a do a manual javascript,
document.forms[0].submit() ?

Any help / pointer welcome
TIA
Sam Martin

Nov 18 '05 #2
thanks bill, i just sussed that out, but thanks - at least i know i've got
it right....but... .

when i perform a callback from an HTML control thats not a submit button,
the LoadPostData() method is not called.

it's called when a submit html button submits the form, but not when called
from an onclick event (from javascript method)

do you know why that would be?

thanks again
sam

"William F. Robertson, Jr." <wfrobertson_at _kpmg_dot_com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
When you are rendering your button, what are you setting the client onclick event to?

You should be setting the onclick to the Page.GetPostBac kClientEvent method.
I usually pass it this and the args.

IE

this.Attributes["onclick"] = Page.GetPostBac kClientEvent( this, "args" );

The "args" will be passed to your RaisePostBackEv ent method and you could
process it then.

bill

"Sam Martin" <sa*********@ya hoo.co.uk> wrote in message
news:Ol******** ******@TK2MSFTN GP09.phx.gbl...
hi,

I'm making a custom control that is rendered implementing the
IPostBackEventH andler interface, and have got it working fine for a single submit button, but how do i pass arguments from the HTML page back to the server, e.g. identify which button has been pressed.

At the moment i can only cause a postback by using a submit button, are
there any other ways? - i.e. can a do a manual javascript,
document.forms[0].submit() ?

Any help / pointer welcome
TIA
Sam Martin


Nov 18 '05 #3
ok, i've sussed it.

need a call to
Page.RegisterRe quiresPostBack( this);

if anyone loosks at this for future ref.

thanks anyway bill

sam

"Sam Martin" <sa*********@ya hoo.co.uk> wrote in message
news:O%******** ********@TK2MSF TNGP09.phx.gbl. ..
thanks bill, i just sussed that out, but thanks - at least i know i've got
it right....but... .

when i perform a callback from an HTML control thats not a submit button,
the LoadPostData() method is not called.

it's called when a submit html button submits the form, but not when called from an onclick event (from javascript method)

do you know why that would be?

thanks again
sam

"William F. Robertson, Jr." <wfrobertson_at _kpmg_dot_com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
When you are rendering your button, what are you setting the client

onclick
event to?

You should be setting the onclick to the Page.GetPostBac kClientEvent

method.

I usually pass it this and the args.

IE

this.Attributes["onclick"] = Page.GetPostBac kClientEvent( this, "args" );

The "args" will be passed to your RaisePostBackEv ent method and you could process it then.

bill

"Sam Martin" <sa*********@ya hoo.co.uk> wrote in message
news:Ol******** ******@TK2MSFTN GP09.phx.gbl...
hi,

I'm making a custom control that is rendered implementing the
IPostBackEventH andler interface, and have got it working fine for a

single submit button, but how do i pass arguments from the HTML page back to the server, e.g. identify which button has been pressed.

At the moment i can only cause a postback by using a submit button, are there any other ways? - i.e. can a do a manual javascript,
document.forms[0].submit() ?

Any help / pointer welcome
TIA
Sam Martin



Nov 18 '05 #4
Yes, you were right on track.

Sorry I didn't get back to you, but you didn't need help anyway. <grin>
You probably picked up on some other tidbits of knowledge looking it up!

bill

"Sam Martin" <sa*********@ya hoo.co.uk> wrote in message
news:uM******** ******@TK2MSFTN GP11.phx.gbl...
ok, i've sussed it.

need a call to
Page.RegisterRe quiresPostBack( this);

if anyone loosks at this for future ref.

thanks anyway bill

sam

"Sam Martin" <sa*********@ya hoo.co.uk> wrote in message
news:O%******** ********@TK2MSF TNGP09.phx.gbl. ..
thanks bill, i just sussed that out, but thanks - at least i know i've got
it right....but... .

when i perform a callback from an HTML control thats not a submit button, the LoadPostData() method is not called.

it's called when a submit html button submits the form, but not when

called
from an onclick event (from javascript method)

do you know why that would be?

thanks again
sam

"William F. Robertson, Jr." <wfrobertson_at _kpmg_dot_com> wrote in message news:%2******** ********@tk2msf tngp13.phx.gbl. ..
When you are rendering your button, what are you setting the client

onclick
event to?

You should be setting the onclick to the Page.GetPostBac kClientEvent

method.

I usually pass it this and the args.

IE

this.Attributes["onclick"] = Page.GetPostBac kClientEvent( this, "args" );
The "args" will be passed to your RaisePostBackEv ent method and you could process it then.

bill

"Sam Martin" <sa*********@ya hoo.co.uk> wrote in message
news:Ol******** ******@TK2MSFTN GP09.phx.gbl...
> hi,
>
> I'm making a custom control that is rendered implementing the
> IPostBackEventH andler interface, and have got it working fine for a

single
> submit button, but how do i pass arguments from the HTML page back
to the
> server, e.g. identify which button has been pressed.
>
> At the moment i can only cause a postback by using a submit button,

are > there any other ways? - i.e. can a do a manual javascript,
> document.forms[0].submit() ?
>
> Any help / pointer welcome
> TIA
> Sam Martin
>
>



Nov 18 '05 #5

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

Similar topics

0
4784
by: Shane O. Pinnell | last post by:
I am sure this has come up before, but I haven't been able to find an answer as of yet. That said, any help is definitely appreciated! I have a datagrid populated from a dataset. I have a TemplateColumn with a DropDownList (DDL) in the FooterItemTemplate that is populated in the Page_Load event using a Sub Routine as the DataSource of the DDL. The FooterItemTemplate's DDL populates as expected when the DataGrid's DataBind method is called. ...
1
1972
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 point out the really obvious and stupid thing I'm overlooking here. :) I have a custom control that provides a tasklist similar to what you get in certain parts of Office. On the client it consists of a bunch of nested, named and id'ed divs with...
0
1210
by: nedk | last post by:
I am getting the following error when attempting to login to a site where I am trying to use Membership. Does anyone know why I am getting this error and how to fix it. Thanks in advance. -Ned Server Error in '/testweb' Application. -------------------------------------------------------------------------------- This feature is not supported at the configured trust level. Description: An unhandled exception occurred during the...
1
3452
by: Mr Newbie | last post by:
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.
0
2083
by: nate | last post by:
the error returned is this: Server Error in '/AnnAccRpt' Application. -------------------------------------------------------------------------------- Could not find control 'DropDownList1' in ControlParameter 'DropDownList1'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
2
2249
by: Learner | last post by:
Hello, I have defined another textbox control in the CreateUserWizard control and this is how I am trying to get the value of it in the code behind page is below im myStep As CreateUserWizardStep = New CreateUserWizardStep Dim DealerShipIDvalue As TextBox = myStep.ContentTemplateContainer.FindControl("_txtDealerShipID") Dim dealer As String dealer = Server.HtmlEncode(DealerShipIDvalue.Text)
0
1631
by: tom c | last post by:
I am going through "Walkthrough: Editing and Inserting Data in Web Pages with the DetailsView Web Server Control" found at http://msdn2.microsoft.com/en-us/library/sdba1d59.aspx I am using Access instead of SQL Server. Everything works fine until I get to the last step, where I try to insert a record. When I hit the New link it lets me add the new data, but then when I hit Insert, I get the yellow page which I have paseted below. I...
0
1081
by: Reshma Prabhu | last post by:
Hi, I have created a custom control derived from CompositeControl class. It implements the IPostBackEventHandler interface. It consists of multiple child controls which are hyperlinks which post back data whenever clicked. I want to get a post back event in RaisePostBackEvent method of IPostBackEventHandler interface. But the control is never coming in the RaisePostBackEvent method. I also tried is using...
3
2075
by: deneushasler | last post by:
Hello my name is Juan Jose. My problem is as follows. When I try to insert a record into a table (access) to control DetailsView Visual Web Developer 2005, when I run the page and insert a record pulse, whenever I get the following error: How could fix it?
0
8672
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8614
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7153
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6107
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5561
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4075
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2603
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1474
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.