473,756 Members | 3,390 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I cause a postback in code?

dee
Hi
How can I cause a postback in code, e.g., without clicking on a button?
Thanks.
Dee
Nov 19 '05 #1
10 17570
Surely it is possible but my advice u to use a link button set
style="display: none" and use javascript (click method) to raise click
event....
--

Thanks,
Yunus Emre ALPÖZEN
BSc, MCAD.NET

"dee" <dee@home> wrote in message
news:u$******** *****@tk2msftng p13.phx.gbl...
Hi
How can I cause a postback in code, e.g., without clicking on a button?
Thanks.
Dee

Nov 19 '05 #2
try document.forms[0].submit();

"dee" wrote:
Hi
How can I cause a postback in code, e.g., without clicking on a button?
Thanks.
Dee

Nov 19 '05 #3
Page.GetPostBac kClientEvent

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi
How can I cause a postback in code, e.g., without clicking on a
button?
Thanks.
Dee


Nov 19 '05 #4
TJS
It would have been nice if they had named it "Page.submi t" :)
"Brock Allen" <ba****@NOSPAMd evelop.com> wrote in message
news:62******** **************@ msnews.microsof t.com...
Page.GetPostBac kClientEvent

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi
How can I cause a postback in code, e.g., without clicking on a
button?
Thanks.
Dee


Nov 19 '05 #5
Well, it's not quite that simple. You use this method to get a block of javascript
and then you have to attach it somewhere in the rendered HTML (typically
in some client side javascript event). Once the client side event fires,
then it will execute this javascript which triggers the postback.

-Brock
DevelopMentor
http://staff.develop.com/ballen
It would have been nice if they had named it "Page.submi t" :)

"Brock Allen" <ba****@NOSPAMd evelop.com> wrote in message
news:62******** **************@ msnews.microsof t.com...
Page.GetPostBac kClientEvent

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi
How can I cause a postback in code, e.g., without clicking on a
button?
Thanks.
Dee


Nov 19 '05 #6
dee
How would I invoke javascript code form .NET code?
Thanks

"Yunus Emre ALPÖZEN [MCAD.NET]" <ye***@msakadem ik.net> wrote in message
news:Od******** ******@tk2msftn gp13.phx.gbl...
Surely it is possible but my advice u to use a link button set
style="display: none" and use javascript (click method) to raise click
event....
--

Thanks,
Yunus Emre ALPÖZEN
BSc, MCAD.NET

"dee" <dee@home> wrote in message
news:u$******** *****@tk2msftng p13.phx.gbl...
Hi
How can I cause a postback in code, e.g., without clicking on a button?
Thanks.
Dee


Nov 19 '05 #7
dee
how can i call that from .net?
thanks

"ural" <ur**@discussio ns.microsoft.co m> wrote in message
news:21******** *************** ***********@mic rosoft.com...
try document.forms[0].submit();

"dee" wrote:
Hi
How can I cause a postback in code, e.g., without clicking on a button?
Thanks.
Dee

Nov 19 '05 #8
Microsoft .NET Framework works at server side.
Javascript works on client side.

You should use javascript to submit form. For instance,
<a id="s">a</a>

at javascript code,

s.click()
--

Thanks,
Yunus Emre ALPÖZEN
BSc, MCAD.NET

"dee" <dee@home> wrote in message
news:uJ******** ******@tk2msftn gp13.phx.gbl...
How would I invoke javascript code form .NET code?
Thanks

"Yunus Emre ALPÖZEN [MCAD.NET]" <ye***@msakadem ik.net> wrote in message
news:Od******** ******@tk2msftn gp13.phx.gbl...
Surely it is possible but my advice u to use a link button set
style="display: none" and use javascript (click method) to raise click
event....
--

Thanks,
Yunus Emre ALPÖZEN
BSc, MCAD.NET

"dee" <dee@home> wrote in message
news:u$******** *****@tk2msftng p13.phx.gbl...
Hi
How can I cause a postback in code, e.g., without clicking on a button?
Thanks.
Dee



Nov 19 '05 #9
TJS
I love the way .net has made things so easy
"Brock Allen" <ba****@NOSPAMd evelop.com> wrote in message
news:62******** **************@ msnews.microsof t.com...
Well, it's not quite that simple. You use this method to get a block of
javascript and then you have to attach it somewhere in the rendered HTML
(typically in some client side javascript event). Once the client side
event fires, then it will execute this javascript which triggers the
postback.

-Brock
DevelopMentor
http://staff.develop.com/ballen
It would have been nice if they had named it "Page.submi t" :)

"Brock Allen" <ba****@NOSPAMd evelop.com> wrote in message
news:62******** **************@ msnews.microsof t.com...
Page.GetPostBac kClientEvent

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi
How can I cause a postback in code, e.g., without clicking on a
button?
Thanks.
Dee


Nov 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
5629
by: martin | last post by:
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
1
1225
by: Angel | last post by:
I have a button, combo, and custom control that i created. When I click the button i want to set certain display properties of my custom control depending whats in the combo. I set those properties in the Click_Event in the button control. Unfortunately postback is triggered in the click event before I set the display properties of the control. Is there anyway that I can set these properties before the postback is triggered? I'd like to do this...
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) *** }
8
11165
by: walesboy | last post by:
greetings - I have a btnSubmit button with a Handles btnSubmit.click which works great if all the user does is click that button. But, if the user ALSO changes a text box on the page (which has it's own event and autopostback=true) before clicking submit then it fires the text box event but never fires the btnSubmit event. (I follow it in the trace). Surely both event handlers should be fired? Any hints on identifying what I
4
15257
by: Aidas Pasilis | last post by:
I'm saving some values to the Session state and get some strange results. To be short I'll write example code and standart behavior: Code Example: ///////////////////////////////////////////////////////////////////////////////////////// private void WriteToSessionButton_Click(object sender, , System.EventArgs e) { Session = "My value";
1
1497
by: mr. dropdown | last post by:
Is it possible that a javascript code will raise postback? I mean, without any control related to the postback, just submit the webform with all the data, into some server method? Thanks
1
1661
by: Andreas Bergmeier | last post by:
Hi. Is there some KB article how to use EnableEventValidation when doing customized posts? Basicly we're building a post string via javascript and issue it via means of XMLHttpRequest to the server. This worked fine in .NET 1.1 Now in ASP.NET 2.0 I get an error message: 'Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/in configuration or <%@ Page EnableEventValidation="true"...
4
13308
by: Chris | last post by:
Hi, i 'm experimenting with postback and i tried that with a button server control and an Html input button but with runat="server". The button server control causes a postback, but not the Html input button with runat="server". Can someone explain me why (because it's running on the server)? Thanks
7
7004
by: =?Utf-8?B?TWlrZSBMb2dhbg==?= | last post by:
My environment. .Net 2.0 VS2k5 SP1, IE6 (6.0.2900.2180) I have a web content page. The page will post back twice if I am running in debug mode. However if I run through the breakpoints fast enough the page will not post back twice. I have disabled Google Popup blocker, windows firewall, a soap collector service. Something wierd with IE is if I sit in debug long enough the page will go
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
10031
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
9869
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...
0
9708
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8709
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6534
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5140
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3805
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3354
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2665
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.