Link to cause postback

  • Thread starter Thread starter martin
  • Start date Start date
M

martin

Hi,

I would like to place a normal link <a href=..> on my webpage and when it is
clicked for the form to be posted back.

I guess that I will have to have to link point to some javascript code and
have the javascript code "submit" the form, in order for the postback to be
initialed.

Could somebody please tell me how I would initiate a form submission from
javascript so that a specific handler runs when the page is submitted.

I know that I could use a button for this for a button does not suit my
needs.

any help is appreciated.

cheers

martin.
 
Martin.

I think the LinkButton will do the job.
It is a link with some javascript code which submits the form.

The generated HTML looks like this:
<a id="ToppageUC1_Mainmenubuild2_BemestingButton1_LinkButton1"
class="MenuButton"
href="javascript:__doPostBack('ToppageUC1$Mainmenubuild2$BemestingButton1$Li
nkButton1','')">Düngemittel</a>

As you can see, it is a normal link, but the href contains the Autogenerated
javascript.

Greetz,
Ben
 
I'm curious as to why you can't use a server-side linkbutton control. You
wouldn't need the JavaScript.
 
Back
Top