Link to cause postback

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.
 
B

Ben de Vette

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
 
K

Ken Cox [Microsoft MVP]

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

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top