Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Link to cause postback

Reply
Thread Tools

Link to cause postback

 
 
martin
Guest
Posts: n/a
 
      05-11-2004
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.




 
Reply With Quote
 
 
 
 
Ben de Vette
Guest
Posts: n/a
 
      05-12-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>
>
>
>



 
Reply With Quote
 
 
 
 
Ken Cox [Microsoft MVP]
Guest
Posts: n/a
 
      05-12-2004
I'm curious as to why you can't use a server-side linkbutton control. You
wouldn't need the JavaScript.

"martin" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>
>
>
>


 
Reply With Quote
 
martin
Guest
Posts: n/a
 
      05-12-2004
Thnak you for that.

A link button will work fine.

cheers

martin.


"Ben de Vette" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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.
> >
> >
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RE: Link Link Link =?Utf-8?B?REw=?= Windows 64bit 0 05-17-2005 12:15 PM
Re: Link Link Link DANGER WILL ROBINSON!!! Kevin Spencer ASP .Net 0 05-17-2005 10:41 AM
will all these messages cause a problem . I am a new subscriber and my computer is downloading 100,000 messages. Will this cause any kind of a problem with my ability to store other items?? Camille White Camille White Computer Support 9 11-08-2004 01:13 AM
cause page to postback to server? szabelin ASP .Net 1 08-20-2003 05:12 PM
Re: Client side action to cause postback Vidar Petursson ASP .Net 3 07-11-2003 07:45 PM



Advertisments