By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,727 Members | 766 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,727 IT Pros & Developers. It's quick & easy.

Link to cause postback

P: n/a
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.


Nov 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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_Lin kButton1"
class="MenuButton"
href="javascript:__doPostBack('ToppageUC1$Mainmenu build2$BemestingButton1$Li
nkButton1','')">DŁngemittel</a>

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

Greetz,
Ben

"martin" <St**************@yahoo.com> wrote in message
news:eJ**************@TK2MSFTNGP11.phx.gbl...
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.

Nov 18 '05 #2

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

"martin" <St**************@yahoo.com> wrote in message
news:eJ**************@TK2MSFTNGP11.phx.gbl...
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.


Nov 18 '05 #3

P: n/a
Thnak you for that.

A link button will work fine.

cheers

martin.
"Ben de Vette" <Be****************@profiler.nl> wrote in message
news:10*************@corp.supernews.com...
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_Lin kButton1"
class="MenuButton"
href="javascript:__doPostBack('ToppageUC1$Mainmenu build2$BemestingButton1$Li nkButton1','')">DŁngemittel</a>

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

Greetz,
Ben

"martin" <St**************@yahoo.com> wrote in message
news:eJ**************@TK2MSFTNGP11.phx.gbl...
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.


Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.