473,385 Members | 1,736 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Link to cause postback

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
3 5620
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Gopal Krish | last post by:
I'm have coded a simple menu (using link buttons as menu items) in a user control to be reused across many ASPX pages. In the page_load method I dynamically create the link buttons as follows ...
1
by: M | last post by:
It's possible to call a Page PostBack with a link (<a href='....'>link</a>)? I would like only to add to the QueryString a parameter (i.e. PageN=3 ) and then calling a PostBack Can I do...
4
by: louise raisbeck | last post by:
I have this scenario (simplified) function addnewdata () { check for partial match already in db for information entered by user if (partialmatch succeeds) { open new window aspx page (using...
1
by: darrel | last post by:
I have a form that has a 'sub-form' in it that updates a separate table. I can easily add records to this table from within this page. To delete, though, I've been redirecting to a different...
10
by: dee | last post by:
Hi How can I cause a postback in code, e.g., without clicking on a button? Thanks. Dee
2
by: ChrisA | last post by:
I want the Return Key to do a postback of an ASP.Net form. What's the right way to set that up?? I don't want to interfere with the asp.net framework. I guess my options are to set the ACTION...
2
by: Ivers | last post by:
My C# asp.net app (.NET 1.1) can generate an email whose body contains a link to the current page of the app. When the recipient of the email clicks the link (usually from Outlook), the app...
5
by: Amoril | last post by:
I've read quite a few different message on various boards and for some reason I'm still having trouble wrapping my head around this viewstate maintenance and trying to get these dynamically created...
4
by: =?Utf-8?B?UGF1bA==?= | last post by:
Just wondering if there is a way to cause a post back with a javascript function? Thanks. -- Paul G Software engineer.
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.