468,115 Members | 2,111 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,115 developers. It's quick & easy.

cause postback with javascript function

Just wondering if there is a way to cause a post back with a javascript
function?
Thanks.
--
Paul G
Software engineer.
Oct 29 '08 #1
4 6702
Pretty much that is the only way :)
Dump any empty (not text propery specified ) LinkButton on the form and
check out generated HTML.
You will see somehting like OnClick="__doPostBack('$LinkButton1');"

that is the way :)

George.

"Paul" <Pa**@discussions.microsoft.comwrote in message
news:47**********************************@microsof t.com...
Just wondering if there is a way to cause a post back with a javascript
function?
Thanks.
--
Paul G
Software engineer.
Oct 29 '08 #2

"Paul" <Pa**@discussions.microsoft.comwrote in message
news:47**********************************@microsof t.com...
Just wondering if there is a way to cause a post back with a javascript
function?
Thanks.
--
Paul G
Software engineer.
Check out the __doPostBack javascript function. This is what gets called on
a regular asp.net postback. You can set the parameters to values.

Hope this helps
LS

Oct 29 '08 #3
Paul:
You can get the script to cause a postback with this method:
Page.ClientScript.GetPostBackEventReference.
Other way to do this is adding a button to the page and calling it from
JS:

string strJavaScript = button1.ClientID + ".click();";

Good luck!

Gustavo A. Cantero
CEO - Scientia® Soluciones Informáticas
MCP - MCSD - MCTS
http://www.scientia.com.ar
http://www.programandoamedianoche.com
http://foro.scientia.com.ar

-----Mensaje original-----
De: Paul [mailto:Pa**@discussions.microsoft.com]
Expuesto a las: Miércoles, 29 de Octubre de 2008 07:30 p.m.
Expuesto en: microsoft.public.dotnet.framework.aspnet
Conversación: cause postback with javascript function
Asunto: cause postback with javascript function

Just wondering if there is a way to cause a post back with a javascript
function?
Thanks.
--
Paul G
Software engineer.

Oct 29 '08 #4
thanks for the responses, I need to pass parameters to the URL string on the
post back so thinking a few of these methods should work.
--
Paul G
Software engineer.
"Gustavo Cantero" wrote:
Paul:
You can get the script to cause a postback with this method:
Page.ClientScript.GetPostBackEventReference.
Other way to do this is adding a button to the page and calling it from
JS:

string strJavaScript = button1.ClientID + ".click();";

Good luck!

Gustavo A. Cantero
CEO - Scientia® Soluciones Informáticas
MCP - MCSD - MCTS
http://www.scientia.com.ar
http://www.programandoamedianoche.com
http://foro.scientia.com.ar

-----Mensaje original-----
De: Paul [mailto:Pa**@discussions.microsoft.com]
Expuesto a las: Miércoles, 29 de Octubre de 2008 07:30 p.m.
Expuesto en: microsoft.public.dotnet.framework.aspnet
Conversación: cause postback with javascript function
Asunto: cause postback with javascript function

Just wondering if there is a way to cause a post back with a javascript
function?
Thanks.
--
Paul G
Software engineer.

Oct 29 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Viktor Popov | last post: by
1 post views Thread by Silvia Brunet-Jones | last post: by
6 posts views Thread by szabelin | last post: by
1 post views Thread by Svein Terje Gaup | last post: by
1 post views Thread by jeff_m | last post: by
5 posts views Thread by Mike McIntyre | last post: by
5 posts views Thread by didacticone | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.