By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,300 Members | 1,867 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,300 IT Pros & Developers. It's quick & easy.

Command Based Postback?

P: n/a
I need to be able to from C# launch a postback.

I have a command button that launches a function, I also have a javascript
function that then keeps you from firing any other objects on the page, but
when the function finishes the page needs to postback, but my function is in
codebehind.

What command do I need to call to say in my finnaly to postback my page???
--
D @ premierdata
Nov 19 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
you can't directly. your client code needs to poll the server in some
fashion: iframe, xmlhttp or meta refresh. google this newsgroup for progress
bar for hints.

-- bruce (sqlwork.com)
"DE*********@online.nospam" <de*********@online.nospam> wrote in message
news:92**********************************@microsof t.com...
I need to be able to from C# launch a postback.

I have a command button that launches a function, I also have a javascript
function that then keeps you from firing any other objects on the page,
but
when the function finishes the page needs to postback, but my function is
in
codebehind.

What command do I need to call to say in my finnaly to postback my page???
--
D @ premierdata

Nov 19 '05 #2

P: n/a
What I am doing is a Response.WriteFile that I can't have interupted.

What option do I have in this manner as one this file has finished
downloading the page needs to refresh to release my dataset.

There has to be a DotNet way of doing something like the meta-refresh.
--
D @ premierdata
"Bruce Barker" wrote:
you can't directly. your client code needs to poll the server in some
fashion: iframe, xmlhttp or meta refresh. google this newsgroup for progress
bar for hints.

-- bruce (sqlwork.com)
"DE*********@online.nospam" <de*********@online.nospam> wrote in message
news:92**********************************@microsof t.com...
I need to be able to from C# launch a postback.

I have a command button that launches a function, I also have a javascript
function that then keeps you from firing any other objects on the page,
but
when the function finishes the page needs to postback, but my function is
in
codebehind.

What command do I need to call to say in my finnaly to postback my page???
--
D @ premierdata


Nov 19 '05 #3

P: n/a
the .net way of meta-refresh is meta-refresh. you could release your dataset
after the filewrite.

not sure what you are trying to do, but probably you have a page, that
downloads a file, which you want to refresh when the file download is done.

this is done by by starting the download in another window (using client
script), then having the main page poll the backend for the download to be
complete (well close to done, as the backend only knows when the last
buffer was sent, not when the client received it). you will not want to use
the writefile method, because you will need to turn buffering off, and
update the status in the server (say in session or app object) after every
buffer write (say 2k buffers), so the polling page can see how far along the
download is.

-- bruce (sqlwork.com)
"DE*********@online.nospam" <de*********@online.nospam> wrote in message
news:58**********************************@microsof t.com...
What I am doing is a Response.WriteFile that I can't have interupted.

What option do I have in this manner as one this file has finished
downloading the page needs to refresh to release my dataset.

There has to be a DotNet way of doing something like the meta-refresh.
--
D @ premierdata
"Bruce Barker" wrote:
you can't directly. your client code needs to poll the server in some
fashion: iframe, xmlhttp or meta refresh. google this newsgroup for
progress
bar for hints.

-- bruce (sqlwork.com)
"DE*********@online.nospam" <de*********@online.nospam> wrote in message
news:92**********************************@microsof t.com...
>I need to be able to from C# launch a postback.
>
> I have a command button that launches a function, I also have a
> javascript
> function that then keeps you from firing any other objects on the page,
> but
> when the function finishes the page needs to postback, but my function
> is
> in
> codebehind.
>
> What command do I need to call to say in my finnaly to postback my
> page???
> --
> D @ premierdata


Nov 19 '05 #4

P: n/a
Hi Dewright,

I think Bruce's suggestions are reasonable. As you mentioned that you'd
like to enforce the page to postback from clientside to server after the
serverside processing code finish, I'm not sure why don't you just let your
sequential code just execute after yoru former serverside code? Since let
the page return back to client and then postback will involve additional
round trip between client/server which has performance concerns.

In addition, if you do need to force a clientside postback(through code
behind serverside code), we can use the
Page.RegisterStartupScript method to register a postback script to
clietnside.

#Page.RegisterStartupScript Method
http://msdn.microsoft.com/library/en...webuipageclass
registerstartupscripttopic.asp?frame=true

For example, we can register the document.form1.submit() to force the page
submit it self.

IF you have any further particular requirement or questions, please feel
free to let us know.

Thanks & Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
| From: "Bruce Barker" <br******************@safeco.com>
| References: <92**********************************@microsoft.co m>
<OW*************@TK2MSFTNGP14.phx.gbl>
<58**********************************@microsoft.co m>
| Subject: Re: Command Based Postback?
| Date: Wed, 13 Jul 2005 17:01:28 -0700
| Lines: 62
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| Message-ID: <uk**************@TK2MSFTNGP09.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: rdcsd1.safeco.com 12.144.134.2
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:112075
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| the .net way of meta-refresh is meta-refresh. you could release your
dataset
| after the filewrite.
|
| not sure what you are trying to do, but probably you have a page, that
| downloads a file, which you want to refresh when the file download is
done.
|
| this is done by by starting the download in another window (using client
| script), then having the main page poll the backend for the download to
be
| complete (well close to done, as the backend only knows when the last
| buffer was sent, not when the client received it). you will not want to
use
| the writefile method, because you will need to turn buffering off, and
| update the status in the server (say in session or app object) after
every
| buffer write (say 2k buffers), so the polling page can see how far along
the
| download is.
|
| -- bruce (sqlwork.com)
|
|
| "DE*********@online.nospam" <de*********@online.nospam> wrote in message
| news:58**********************************@microsof t.com...
| > What I am doing is a Response.WriteFile that I can't have interupted.
| >
| > What option do I have in this manner as one this file has finished
| > downloading the page needs to refresh to release my dataset.
| >
| > There has to be a DotNet way of doing something like the meta-refresh.
| > --
| > D @ premierdata
| >
| >
| > "Bruce Barker" wrote:
| >
| >> you can't directly. your client code needs to poll the server in some
| >> fashion: iframe, xmlhttp or meta refresh. google this newsgroup for
| >> progress
| >> bar for hints.
| >>
| >> -- bruce (sqlwork.com)
| >>
| >>
| >> "DE*********@online.nospam" <de*********@online.nospam> wrote in
message
| >> news:92**********************************@microsof t.com...
| >> >I need to be able to from C# launch a postback.
| >> >
| >> > I have a command button that launches a function, I also have a
| >> > javascript
| >> > function that then keeps you from firing any other objects on the
page,
| >> > but
| >> > when the function finishes the page needs to postback, but my
function
| >> > is
| >> > in
| >> > codebehind.
| >> >
| >> > What command do I need to call to say in my finnaly to postback my
| >> > page???
| >> > --
| >> > D @ premierdata
| >>
| >>
| >>
|
|
|

Nov 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.