473,396 Members | 1,783 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,396 software developers and data experts.

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

Similar topics

1
by: Viktor Popov | last post by:
I have a javascript functions which are used for populating 2 select boxes. The first select box is used for continent names, the second for the countries in the contint. When I click on a...
1
by: Silvia Brunet-Jones | last post by:
Ok I am about to pull my hair. I have an active x control in an object tag which, as you know cant have runat=server. So what I need is to not loose what is in this box everytime a postback...
6
by: szabelin | last post by:
Hello, I am trying to call a function inside the javascript block from asp.net during the postback (NOT button's OnClick event handler though). The javascript function creates new popup window. I...
2
by: Jim Hammond | last post by:
The script function in the code below works fine when it is JavaScript, but when I try to use C#, the function doesn't get executed. <body MS_POSITIONING="GridLayout"> <form id="Form1"...
1
by: Svein Terje Gaup | last post by:
When I try to validate my webpages on http://validator.w3.org the validation fails because of the auto-generated postback function: <script language="javascript"> <!-- function...
1
by: jeff_m | last post by:
Hello all, I'm having an issue with the following: I have an .aspx page with two html links that call distinct Javascript functions. I also have an iframe in the html of this .aspx page....
2
by: tarun.kataria | last post by:
Hi all, In my ASP.NET application, I am trying to detect in a javascript function, which is triggered by the event onbeforeunload, that if the window is getting closed beacuse its a post back or...
5
by: Mike McIntyre | last post by:
What event can be used to call a JavaScript function when the page loads AND when it receives a response from the web server? Thanks, -- Mike Mike McIntyre http://www.getdotnetcode.com
2
by: wildman | last post by:
RE: Gridview textbox has data check without postback.. javascript? I have a gridview with a textbox. I can set the textbox to autopostback and check for a value in a prerender event to decide if...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.