473,769 Members | 2,376 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5630
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_ BemestingButton 1_LinkButton1"
class="MenuButt on"
href="javascrip t:__doPostBack( 'ToppageUC1$Mai nmenubuild2$Bem estingButton1$L i
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******** ******@TK2MSFTN GP11.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******** ******@TK2MSFTN GP11.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.n l> wrote in message
news:10******** *****@corp.supe rnews.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_ BemestingButton 1_LinkButton1"
class="MenuButt on"
href="javascrip t:__doPostBack( 'ToppageUC1$Mai nmenubuild2$Bem estingButton1$L i 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******** ******@TK2MSFTN GP11.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
2589
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 LinkButton myLB = new LinkButton(); ......... .........
1
1170
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 something similar? Thanks
4
1921
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 javascript) with a datagrid of these partial match records (by doing a sqlcommand using some query string values taken from opener data entered) *** }
1
1474
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 'delete' page where it asks for confirmation before deleting. This works, but the problem is that I loose my postback information from the main page. Since this is just a small bit of a larger form, I don't want people to fill out half the form, get...
10
17573
by: dee | last post by:
Hi How can I cause a postback in code, e.g., without clicking on a button? Thanks. Dee
2
1096
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 attribute or inject some javascript. This is under 1.2, not 2.0 yet. Thanks
2
2115
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 launches just fine, and will postback great too. However, when the user pastes this link into a PowerPoint 2003 hyperlink, runs the slideshow, and clicks on the link, it brings up the right page, but generates the error "Object reference not set to...
5
6761
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 link buttons to stay wired up to their click events. I have what is basically a simply survey question generation page. The page first displays a few static fields and a dropdownlist of various options for the user to select. When the user...
4
6922
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
9586
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10210
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10043
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9990
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7406
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5446
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2814
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.