Generating __doPostBack & dopostbackwithoptions

  • Thread starter Mike Gleason jr Couturier
  • Start date
M

Mike Gleason jr Couturier

Hi,

I created a custom button and I'm writing the onclick javascript event
myself to cause a postback...


Now I use Validators but I need to use dopostbackwithoptions... Is there any
..NET utility functions to generated the function signature based on a
control ID or anything?!

Thanks
 
S

Stan

Hi,

I created a custom button and I'm writing the onclick javascript event
myself to cause a postback...

Now I use Validators but I need to use dopostbackwithoptions... Is there any
.NET utility functions to generated the function signature based on a
control ID or anything?!

Thanks

Apart from an OnClick event which just indicates to the server that it
was "clicked" what else can a button do during postback? If you need
to convey more information then it will have to be combined with other
controls, the content/state of which (provided ViewState is enabled)
can be read during that same event.
 
P

Peter Bucher [MVP]

Hi Stan
Apart from an OnClick event which just indicates to the server that it
was "clicked" what else can a button do during postback? If you need
to convey more information then it will have to be combined with other
controls, the content/state of which (provided ViewState is enabled)
can be read during that same event.
- Other behavior at client side (doPostBack catches parameters and detect
wheter
a do a postback, do something on client side or chaning the action-attribute
of the Form (PostBackUrl).

Apart from this, on serverside, you can catch some parameters send trought
the doPostback function
in Javascript. See: CommandName, CommandArgument, ...
 
M

Mike Gleason jr Couturier

Peter Bucher said:

ClientScriptManager::GetPostBackEventReference Method

"Returns a string that can be used in a client event to cause postback to
the server. The reference string is defined by the specified PostBackOptions
instance."

That's exactly, exactly what I was looking for!! (I don't want to write my
own javascript string, I try to be compatible with the framework in the
future, or in the past?)

Thanks


Mike
 
P

Peter Bucher [MVP]

Hello Mike
That's exactly, exactly what I was looking for!! (I don't want to write my
own javascript string, I try to be compatible with the framework in the
future, or in the past?)
Jap, so far you would be compatible with the future and the past ;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,075
Messages
2,570,562
Members
47,197
Latest member
NDTShavonn

Latest Threads

Top