Showing posts with label refresh. Show all posts
Showing posts with label refresh. Show all posts

Saturday, March 31, 2012

Server Side code withoout page refresh

Is it possible if I can call server side code without the page
refreshing?

Thanks,

SeanShort answer : no, if it's a postback.
On the first call, yes, of course.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
<seanmle@.gmail.com> wrote in message news:1140807565.766741.128340@.v46g2000cwv.googlegr oups.com...
> Is it possible if I can call server side code without the page
> refreshing?
> Thanks,
> Sean
yes. the techinque is call AJAX. google for toolkits. also asp.net 2.0 has a
very simple (feature wise) implementation for IE.

-- bruce (sqlwork.com)

<seanmle@.gmail.com> wrote in message
news:1140807565.766741.128340@.v46g2000cwv.googlegr oups.com...
> Is it possible if I can call server side code without the page
> refreshing?
> Thanks,
> Sean
Yes.
You can use Remote Scripting callbacks (often now referred to as "AJAX").
This normally involves using XmlHttp from the client - side page DOM to make
a call into the server-side page and call a method on it, returning the
results as either javascript, JSON, or HTML which is used to update the DOM
at the client.

The new Atlas Framework does this for ASP.NET 2.0. You could also look at
Anthem.Net and MagicAJax.net over on Sourceforge.net if you are interested in
using a whole "framework" for this type of operation.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com

"seanmle@.gmail.com" wrote:

> Is it possible if I can call server side code without the page
> refreshing?
> Thanks,
> Sean
>
Here you can find a comparison of AJAX frameworks, that allow page
updates with AJAX without reloading the whole page:
http://www.daniel-zeiss.de/AJAXComparison/Results.htm

Some frameworks allow roundtrips with ASP.NET server events without
updating any page content.
re:
>> Is it possible if I can call server side code without the page refreshing?
> yes. the techinque is call AJAX.

Sure, although you're still posting back...just not the whole page.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Bruce Barker" <brubar_nospamplease_@.safeco.com> wrote in message
news:e9I1uAYOGHA.3888@.TK2MSFTNGP10.phx.gbl...
> yes. the techinque is call AJAX. google for toolkits. also asp.net 2.0 has a very simple (feature
> wise) implementation for IE.
> -- bruce (sqlwork.com)

> <seanmle@.gmail.com> wrote in message news:1140807565.766741.128340@.v46g2000cwv.googlegr oups.com...
>> Is it possible if I can call server side code without the page
>> refreshing?
>>
>> Thanks,
>>
>> Sean

Server Side code withoout page refresh

Is it possible if I can call server side code without the page
refreshing?
Thanks,
SeanShort answer : no, if it's a postback.
On the first call, yes, of course.
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
<seanmle@.gmail.com> wrote in message news:1140807565.766741.128340@.v46g2000cwv.googlegroups
.com...
> Is it possible if I can call server side code without the page
> refreshing?
> Thanks,
> Sean
>
yes. the techinque is call AJAX. google for toolkits. also asp.net 2.0 has a
very simple (feature wise) implementation for IE.
-- bruce (sqlwork.com)
<seanmle@.gmail.com> wrote in message
news:1140807565.766741.128340@.v46g2000cwv.googlegroups.com...
> Is it possible if I can call server side code without the page
> refreshing?
> Thanks,
> Sean
>
Yes.
You can use Remote Scripting callbacks (often now referred to as "AJAX").
This normally involves using XmlHttp from the client - side page DOM to make
a call into the server-side page and call a method on it, returning the
results as either javascript, JSON, or HTML which is used to update the DOM
at the client.
The new Atlas Framework does this for ASP.NET 2.0. You could also look at
Anthem.Net and MagicAJax.net over on Sourceforge.net if you are interested i
n
using a whole "framework" for this type of operation.
Peter
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"seanmle@.gmail.com" wrote:

> Is it possible if I can call server side code without the page
> refreshing?
> Thanks,
> Sean
>
Here you can find a comparison of AJAX frameworks, that allow page
updates with AJAX without reloading the whole page:
http://www.daniel-zeiss.de/AJAXComparison/Results.htm
Some frameworks allow roundtrips with ASP.NET server events without
updating any page content.
re:
> yes. the techinque is call AJAX.
Sure, although you're still posting back...just not the whole page.
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Bruce Barker" <brubar_nospamplease_@.safeco.com> wrote in message
news:e9I1uAYOGHA.3888@.TK2MSFTNGP10.phx.gbl...
> yes. the techinque is call AJAX. google for toolkits. also asp.net 2.0 has
a very simple (feature
> wise) implementation for IE.
> -- bruce (sqlwork.com)
> <seanmle@.gmail.com> wrote in message news:1140807565.766741.128340@.v46g200
0cwv.googlegroups.com...

Monday, March 26, 2012

Server Transfer doesnt Set Focus to Page

This has been driving me crazy. server.transfer doesn't set the focus
to the page I transfer to so when the user does a refresh, the results
aren't what's expected.

I have a datagrid on one page that lists the student's guests. At the
bottom of the datagrid is an 'add a new guest' button. Users click on
this button an it takes them to a new page where they can add a new
guest. So they type in the guest information and click on the 'save'
button. server.transfer takes them back to the datagrid page where
their guest is listed.

Simple enough, right? The problem is, after you save a guest and return
to the datagrid page, when the user refreshes, it adds the same guest to
the datagrid, creating a duplicate guest entry. It took me a long time
to figure out what is happening. The focus is still on the 'add a
guest' page so when you refresh, it's just like clicking on the 'save'
button.

How do I set the focus to the datagrid page after I save a guest? I
need to use server transfer.It is setting focus, but a refresh forces the same action when you have the
form linked via Server.Transfer(). I would consider going to
Response.Redirect instead as a refresh will only refresh the page rather than
rerun the form submit.

The action you are speaking of is normal, as the browser is asking for a
refresh on the entire process, as it does not realize it has been transfered
on the server side.

--

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

"Jim Bayers" wrote:

> This has been driving me crazy. server.transfer doesn't set the focus
> to the page I transfer to so when the user does a refresh, the results
> aren't what's expected.
> I have a datagrid on one page that lists the student's guests. At the
> bottom of the datagrid is an 'add a new guest' button. Users click on
> this button an it takes them to a new page where they can add a new
> guest. So they type in the guest information and click on the 'save'
> button. server.transfer takes them back to the datagrid page where
> their guest is listed.
> Simple enough, right? The problem is, after you save a guest and return
> to the datagrid page, when the user refreshes, it adds the same guest to
> the datagrid, creating a duplicate guest entry. It took me a long time
> to figure out what is happening. The focus is still on the 'add a
> guest' page so when you refresh, it's just like clicking on the 'save'
> button.
> How do I set the focus to the datagrid page after I save a guest? I
> need to use server transfer.
>

Server Transfer and Back/Refresh...

Apparently, our developers used "server transfer" in our ASP.NET, and
because of this Back/Refresh presses by users are problematic. Apparently
the server has information about state and other things that the browser
does not. The application could get very on Back/Refresh presses.
Is the use of "server transfer' just a bad idea for our type of application?
Can we prevent or nullify Back/Refresh presses using javascript? Bad idea?
Any words or links will be greatly appreciated!
JamesHi James,
I think you have to set EnableViewStateMac property of page directive
to true for not to tamper your session or view state values. Also set
SmartNavigation to true.
Check the below link.
http://msdn.microsoft.com/library/d... />
onPage.asp
Cheers,
Kris
> Is the use of "server transfer' just a bad idea for our type of
> application?
Yes and no. Everything has it's place but mostly you should avoid to use
Server.Transfer just because of those problems.

>Can we prevent or nullify Back/Refresh presses using javascript?
Afraid no. The user is in control and it's hard to prevent him doing that.
George.
"James Hunter Ross" <james.ross@.oneilsoft.com> wrote in message
news:%23H0blalNGHA.1288@.TK2MSFTNGP09.phx.gbl...
> Apparently, our developers used "server transfer" in our ASP.NET, and
> because of this Back/Refresh presses by users are problematic. Apparently
> the server has information about state and other things that the browser
> does not. The application could get very on Back/Refresh
> presses.
> Is the use of "server transfer' just a bad idea for our type of
> application?
> Can we prevent or nullify Back/Refresh presses using javascript? Bad
> idea?
> Any words or links will be greatly appreciated!
> James
>
Thus wrote James,

> Apparently, our developers used "server transfer" in our ASP.NET, and
> because of this Back/Refresh presses by users are problematic.
> Apparently the server has information about state and other things
> that the browser does not. The application could get very on
> Back/Refresh presses.
> Is the use of "server transfer' just a bad idea for our type of
> application? Can we prevent or nullify Back/Refresh presses using
> javascript? Bad idea?
Bad idea. Turn off scripting and... boom.
There's really just one way to fix this: Make your application immune agains
t
these effects, like using Redirect-After-Post or applying synchronizer token
s
in your web forms.
Cheers,
--
Joerg Jooss
news-reply@.joergjooss.de

Server Transfer and Back/Refresh...

Apparently, our developers used "server transfer" in our ASP.NET, and
because of this Back/Refresh presses by users are problematic. Apparently
the server has information about state and other things that the browser
does not. The application could get very confused on Back/Refresh presses.

Is the use of "server transfer' just a bad idea for our type of application?
Can we prevent or nullify Back/Refresh presses using javascript? Bad idea?

Any words or links will be greatly appreciated!

JamesHi James,

I think you have to set EnableViewStateMac property of page directive
to true for not to tamper your session or view state values. Also set
SmartNavigation to true.

Check the below link.
http://msdn.microsoft.com/library/d...l/cpconPage.asp

Cheers,
Kris
> Is the use of "server transfer' just a bad idea for our type of
> application?
Yes and no. Everything has it's place but mostly you should avoid to use
Server.Transfer just because of those problems.

>Can we prevent or nullify Back/Refresh presses using javascript?

Afraid no. The user is in control and it's hard to prevent him doing that.

George.

"James Hunter Ross" <james.ross@.oneilsoft.com> wrote in message
news:%23H0blalNGHA.1288@.TK2MSFTNGP09.phx.gbl...
> Apparently, our developers used "server transfer" in our ASP.NET, and
> because of this Back/Refresh presses by users are problematic. Apparently
> the server has information about state and other things that the browser
> does not. The application could get very confused on Back/Refresh
> presses.
> Is the use of "server transfer' just a bad idea for our type of
> application?
> Can we prevent or nullify Back/Refresh presses using javascript? Bad
> idea?
> Any words or links will be greatly appreciated!
> James
Thus wrote James,

> Apparently, our developers used "server transfer" in our ASP.NET, and
> because of this Back/Refresh presses by users are problematic.
> Apparently the server has information about state and other things
> that the browser does not. The application could get very confused on
> Back/Refresh presses.
> Is the use of "server transfer' just a bad idea for our type of
> application? Can we prevent or nullify Back/Refresh presses using
> javascript? Bad idea?

Bad idea. Turn off scripting and... boom.

There's really just one way to fix this: Make your application immune against
these effects, like using Redirect-After-Post or applying synchronizer tokens
in your web forms.

Cheers,
--
Joerg Jooss
news-reply@.joergjooss.de

Server Transfer doesn't Set Focus to Page

This has been driving me crazy. server.transfer doesn't set the focus
to the page I transfer to so when the user does a refresh, the results
aren't what's expected.
I have a datagrid on one page that lists the student's guests. At the
bottom of the datagrid is an 'add a new guest' button. Users click on
this button an it takes them to a new page where they can add a new
guest. So they type in the guest information and click on the 'save'
button. server.transfer takes them back to the datagrid page where
their guest is listed.
Simple enough, right? The problem is, after you save a guest and return
to the datagrid page, when the user refreshes, it adds the same guest to
the datagrid, creating a duplicate guest entry. It took me a long time
to figure out what is happening. The focus is still on the 'add a
guest' page so when you refresh, it's just like clicking on the 'save'
button.
How do I set the focus to the datagrid page after I save a guest? I
need to use server transfer.It is setting focus, but a refresh forces the same action when you have the
form linked via Server.Transfer(). I would consider going to
Response.Redirect instead as a refresh will only refresh the page rather tha
n
rerun the form submit.
The action you are speaking of is normal, as the browser is asking for a
refresh on the entire process, as it does not realize it has been transfered
on the server side.
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
***************************
Think Outside the Box!
***************************
"Jim Bayers" wrote:

> This has been driving me crazy. server.transfer doesn't set the focus
> to the page I transfer to so when the user does a refresh, the results
> aren't what's expected.
> I have a datagrid on one page that lists the student's guests. At the
> bottom of the datagrid is an 'add a new guest' button. Users click on
> this button an it takes them to a new page where they can add a new
> guest. So they type in the guest information and click on the 'save'
> button. server.transfer takes them back to the datagrid page where
> their guest is listed.
> Simple enough, right? The problem is, after you save a guest and return
> to the datagrid page, when the user refreshes, it adds the same guest to
> the datagrid, creating a duplicate guest entry. It took me a long time
> to figure out what is happening. The focus is still on the 'add a
> guest' page so when you refresh, it's just like clicking on the 'save'
> button.
> How do I set the focus to the datagrid page after I save a guest? I
> need to use server transfer.
>