Monday, March 26, 2012
server to server upload
Should you have a file on the server then you could post it to another
server. This however is an ideal use for windows services as they wont hog
your asp.net worker process while trying to do an upload. If you do it in
ASP, you have to work out how its going to happen as part of a an intial
page request,or schedule the execution of the asp.net page.
--
Regards
John Timney (Microsoft ASP.NET MVP)
--------------
<shameless_author_plug>
Professional .NET for Java Developers with C#
ISBN:1-861007-91-4
Professional Windows Forms
ISBN: 1861005547
Professional JSP 2nd Edition
ISBN: 1861004958
Professional JSP
ISBN: 1861003625
Beginning JSP Web Development
ISBN: 1861002092
</shameless_author_plug>
--------------
"TJS" <nospam@.here.com> wrote in message
news:#v389w0qDHA.3616@.tk2msftngp13.phx.gbl...
> does asp.net have server to server file transfer (upload) capability ?
do you know of any articles which may explain this in a bit more detail ?
"John Timney (Microsoft MVP)" <timneyj@.despammed.com> wrote in message
news:eez77CHrDHA.2304@.TK2MSFTNGP11.phx.gbl...
> The net classes can do form posts (even from within an asp.net page).
> Should you have a file on the server then you could post it to another
> server. This however is an ideal use for windows services as they wont
hog
> your asp.net worker process while trying to do an upload. If you do it in
> ASP, you have to work out how its going to happen as part of a an intial
> page request,or schedule the execution of the asp.net page.
> --
> Regards
> John Timney (Microsoft ASP.NET MVP)
> --------------
> <shameless_author_plug>
> Professional .NET for Java Developers with C#
> ISBN:1-861007-91-4
> Professional Windows Forms
> ISBN: 1861005547
> Professional JSP 2nd Edition
> ISBN: 1861004958
> Professional JSP
> ISBN: 1861003625
> Beginning JSP Web Development
> ISBN: 1861002092
> </shameless_author_plug>
> --------------
> "TJS" <nospam@.here.com> wrote in message
> news:#v389w0qDHA.3616@.tk2msftngp13.phx.gbl...
> > does asp.net have server to server file transfer (upload) capability ?
The Net framework SDK quickstart tutorials have examples of writing windows
services, and have http post examples too. I expect the help docs in
vs.net cover the same material.
--
Regards
John Timney (Microsoft ASP.NET MVP)
--------------
<shameless_author_plug>
Professional .NET for Java Developers with C#
ISBN:1-861007-91-4
Professional Windows Forms
ISBN: 1861005547
Professional JSP 2nd Edition
ISBN: 1861004958
Professional JSP
ISBN: 1861003625
Beginning JSP Web Development
ISBN: 1861002092
</shameless_author_plug>
--------------
"TJS" <nospam@.here.com> wrote in message
news:Oz2ZRrUrDHA.2476@.tk2msftngp13.phx.gbl...
> do you know of any articles which may explain this in a bit more detail ?
>
> "John Timney (Microsoft MVP)" <timneyj@.despammed.com> wrote in message
> news:eez77CHrDHA.2304@.TK2MSFTNGP11.phx.gbl...
> > The net classes can do form posts (even from within an asp.net page).
> > Should you have a file on the server then you could post it to another
> > server. This however is an ideal use for windows services as they wont
> hog
> > your asp.net worker process while trying to do an upload. If you do it
in
> > ASP, you have to work out how its going to happen as part of a an intial
> > page request,or schedule the execution of the asp.net page.
> > --
> > Regards
> > John Timney (Microsoft ASP.NET MVP)
> > --------------
> > <shameless_author_plug>
> > Professional .NET for Java Developers with C#
> > ISBN:1-861007-91-4
> > Professional Windows Forms
> > ISBN: 1861005547
> > Professional JSP 2nd Edition
> > ISBN: 1861004958
> > Professional JSP
> > ISBN: 1861003625
> > Beginning JSP Web Development
> > ISBN: 1861002092
> > </shameless_author_plug>
> > --------------
> > "TJS" <nospam@.here.com> wrote in message
> > news:#v389w0qDHA.3616@.tk2msftngp13.phx.gbl...
> > > does asp.net have server to server file transfer (upload) capability ?
> > >
I found a solution in cold fusion <cfftp>...
works with about 20 lines of code !
you would think something as big as dotnet would have this too ?
"John Timney (Microsoft MVP)" <timneyj@.despammed.com> wrote in message
news:ekqLSIVrDHA.1928@.TK2MSFTNGP12.phx.gbl...
> The Net framework SDK quickstart tutorials have examples of writing
windows
> services, and have http post examples too. I expect the help docs in
> vs.net cover the same material.
> --
> Regards
> John Timney (Microsoft ASP.NET MVP)
> --------------
> <shameless_author_plug>
> Professional .NET for Java Developers with C#
> ISBN:1-861007-91-4
> Professional Windows Forms
> ISBN: 1861005547
> Professional JSP 2nd Edition
> ISBN: 1861004958
> Professional JSP
> ISBN: 1861003625
> Beginning JSP Web Development
> ISBN: 1861002092
> </shameless_author_plug>
> --------------
> "TJS" <nospam@.here.com> wrote in message
> news:Oz2ZRrUrDHA.2476@.tk2msftngp13.phx.gbl...
> > do you know of any articles which may explain this in a bit more detail
?
> > "John Timney (Microsoft MVP)" <timneyj@.despammed.com> wrote in message
> > news:eez77CHrDHA.2304@.TK2MSFTNGP11.phx.gbl...
> > > The net classes can do form posts (even from within an asp.net page).
> > > Should you have a file on the server then you could post it to another
> > > server. This however is an ideal use for windows services as they
wont
> > hog
> > > your asp.net worker process while trying to do an upload. If you do
it
> in
> > > ASP, you have to work out how its going to happen as part of a an
intial
> > > page request,or schedule the execution of the asp.net page.
> > > > --
> > > Regards
> > > > John Timney (Microsoft ASP.NET MVP)
> > > --------------
> > > <shameless_author_plug>
> > > Professional .NET for Java Developers with C#
> > > ISBN:1-861007-91-4
> > > Professional Windows Forms
> > > ISBN: 1861005547
> > > Professional JSP 2nd Edition
> > > ISBN: 1861004958
> > > Professional JSP
> > > ISBN: 1861003625
> > > Beginning JSP Web Development
> > > ISBN: 1861002092
> > > </shameless_author_plug>
> > > --------------
> > > > "TJS" <nospam@.here.com> wrote in message
> > > news:#v389w0qDHA.3616@.tk2msftngp13.phx.gbl...
> > > > does asp.net have server to server file transfer (upload) capability
?
> > > > > > > >
Well it does - in about 20 lines, but as I suggested - doing posts from asp
(or cold fusion from that matter I expect), has the potential to hog your
worker process and block IIS, which is why I recommended doing it from
outside IIS.
--
Regards
John Timney (Microsoft ASP.NET MVP)
--------------
<shameless_author_plug>
Professional .NET for Java Developers with C#
ISBN:1-861007-91-4
Professional Windows Forms
ISBN: 1861005547
Professional JSP 2nd Edition
ISBN: 1861004958
Professional JSP
ISBN: 1861003625
Beginning JSP Web Development
ISBN: 1861002092
</shameless_author_plug>
--------------
"TJS" <nospam@.here.com> wrote in message
news:uXlUL2xrDHA.1764@.TK2MSFTNGP10.phx.gbl...
> I found a solution in cold fusion <cfftp>...
> works with about 20 lines of code !
> you would think something as big as dotnet would have this too ?
>
>
> "John Timney (Microsoft MVP)" <timneyj@.despammed.com> wrote in message
> news:ekqLSIVrDHA.1928@.TK2MSFTNGP12.phx.gbl...
> > The Net framework SDK quickstart tutorials have examples of writing
> windows
> > services, and have http post examples too. I expect the help docs in
> > vs.net cover the same material.
> > --
> > Regards
> > John Timney (Microsoft ASP.NET MVP)
> > --------------
> > <shameless_author_plug>
> > Professional .NET for Java Developers with C#
> > ISBN:1-861007-91-4
> > Professional Windows Forms
> > ISBN: 1861005547
> > Professional JSP 2nd Edition
> > ISBN: 1861004958
> > Professional JSP
> > ISBN: 1861003625
> > Beginning JSP Web Development
> > ISBN: 1861002092
> > </shameless_author_plug>
> > --------------
> > "TJS" <nospam@.here.com> wrote in message
> > news:Oz2ZRrUrDHA.2476@.tk2msftngp13.phx.gbl...
> > > do you know of any articles which may explain this in a bit more
detail
> ?
> > > > > "John Timney (Microsoft MVP)" <timneyj@.despammed.com> wrote in message
> > > news:eez77CHrDHA.2304@.TK2MSFTNGP11.phx.gbl...
> > > > The net classes can do form posts (even from within an asp.net
page).
> > > > Should you have a file on the server then you could post it to
another
> > > > server. This however is an ideal use for windows services as they
> wont
> > > hog
> > > > your asp.net worker process while trying to do an upload. If you do
> it
> > in
> > > > ASP, you have to work out how its going to happen as part of a an
> intial
> > > > page request,or schedule the execution of the asp.net page.
> > > > > > --
> > > > Regards
> > > > > > John Timney (Microsoft ASP.NET MVP)
> > > > --------------
> > > > <shameless_author_plug>
> > > > Professional .NET for Java Developers with C#
> > > > ISBN:1-861007-91-4
> > > > Professional Windows Forms
> > > > ISBN: 1861005547
> > > > Professional JSP 2nd Edition
> > > > ISBN: 1861004958
> > > > Professional JSP
> > > > ISBN: 1861003625
> > > > Beginning JSP Web Development
> > > > ISBN: 1861002092
> > > > </shameless_author_plug>
> > > > --------------
> > > > > > "TJS" <nospam@.here.com> wrote in message
> > > > news:#v389w0qDHA.3616@.tk2msftngp13.phx.gbl...
> > > > > does asp.net have server to server file transfer (upload)
capability
> ?
> > > > > > > > > > > > > > >
no matter...
it's on a web host , they offer it , and it works :)
"John Timney (Microsoft MVP)" <timneyj@.despammed.com> wrote in message
news:u8JQKb7rDHA.1764@.TK2MSFTNGP10.phx.gbl...
> Well it does - in about 20 lines, but as I suggested - doing posts from
asp
> (or cold fusion from that matter I expect), has the potential to hog your
> worker process and block IIS, which is why I recommended doing it from
> outside IIS.
> --
> Regards
> John Timney (Microsoft ASP.NET MVP)
> --------------
> <shameless_author_plug>
> Professional .NET for Java Developers with C#
> ISBN:1-861007-91-4
> Professional Windows Forms
> ISBN: 1861005547
> Professional JSP 2nd Edition
> ISBN: 1861004958
> Professional JSP
> ISBN: 1861003625
> Beginning JSP Web Development
> ISBN: 1861002092
> </shameless_author_plug>
> --------------
> "TJS" <nospam@.here.com> wrote in message
> news:uXlUL2xrDHA.1764@.TK2MSFTNGP10.phx.gbl...
> > I found a solution in cold fusion <cfftp>...
> > works with about 20 lines of code !
> > you would think something as big as dotnet would have this too ?
> > "John Timney (Microsoft MVP)" <timneyj@.despammed.com> wrote in message
> > news:ekqLSIVrDHA.1928@.TK2MSFTNGP12.phx.gbl...
> > > The Net framework SDK quickstart tutorials have examples of writing
> > windows
> > > services, and have http post examples too. I expect the help docs in
> > > vs.net cover the same material.
> > > > --
> > > Regards
> > > > John Timney (Microsoft ASP.NET MVP)
> > > --------------
> > > <shameless_author_plug>
> > > Professional .NET for Java Developers with C#
> > > ISBN:1-861007-91-4
> > > Professional Windows Forms
> > > ISBN: 1861005547
> > > Professional JSP 2nd Edition
> > > ISBN: 1861004958
> > > Professional JSP
> > > ISBN: 1861003625
> > > Beginning JSP Web Development
> > > ISBN: 1861002092
> > > </shameless_author_plug>
> > > --------------
> > > > "TJS" <nospam@.here.com> wrote in message
> > > news:Oz2ZRrUrDHA.2476@.tk2msftngp13.phx.gbl...
> > > > do you know of any articles which may explain this in a bit more
> detail
> > ?
> > > > > > > > "John Timney (Microsoft MVP)" <timneyj@.despammed.com> wrote in
message
> > > > news:eez77CHrDHA.2304@.TK2MSFTNGP11.phx.gbl...
> > > > > The net classes can do form posts (even from within an asp.net
> page).
> > > > > Should you have a file on the server then you could post it to
> another
> > > > > server. This however is an ideal use for windows services as they
> > wont
> > > > hog
> > > > > your asp.net worker process while trying to do an upload. If you
do
> > it
> > > in
> > > > > ASP, you have to work out how its going to happen as part of a an
> > intial
> > > > > page request,or schedule the execution of the asp.net page.
> > > > > > > > --
> > > > > Regards
> > > > > > > > John Timney (Microsoft ASP.NET MVP)
> > > > > --------------
> > > > > <shameless_author_plug>
> > > > > Professional .NET for Java Developers with C#
> > > > > ISBN:1-861007-91-4
> > > > > Professional Windows Forms
> > > > > ISBN: 1861005547
> > > > > Professional JSP 2nd Edition
> > > > > ISBN: 1861004958
> > > > > Professional JSP
> > > > > ISBN: 1861003625
> > > > > Beginning JSP Web Development
> > > > > ISBN: 1861002092
> > > > > </shameless_author_plug>
> > > > > --------------
> > > > > > > > "TJS" <nospam@.here.com> wrote in message
> > > > > news:#v389w0qDHA.3616@.tk2msftngp13.phx.gbl...
> > > > > > does asp.net have server to server file transfer (upload)
> capability
> > ?
> > > > > > > > > > > > > > > > > > > > > > > >
glad you have a solution
--
Regards
John Timney (Microsoft ASP.NET MVP)
--------------
<shameless_author_plug>
Professional .NET for Java Developers with C#
ISBN:1-861007-91-4
Professional Windows Forms
ISBN: 1861005547
Professional JSP 2nd Edition
ISBN: 1861004958
Professional JSP
ISBN: 1861003625
Beginning JSP Web Development
ISBN: 1861002092
</shameless_author_plug>
--------------
"TJS" <nospam@.here.com> wrote in message
news:uM9RPaAsDHA.3436@.tk2msftngp13.phx.gbl...
> no matter...
> it's on a web host , they offer it , and it works :)
>
> "John Timney (Microsoft MVP)" <timneyj@.despammed.com> wrote in message
> news:u8JQKb7rDHA.1764@.TK2MSFTNGP10.phx.gbl...
> > Well it does - in about 20 lines, but as I suggested - doing posts from
> asp
> > (or cold fusion from that matter I expect), has the potential to hog
your
> > worker process and block IIS, which is why I recommended doing it from
> > outside IIS.
> > --
> > Regards
> > John Timney (Microsoft ASP.NET MVP)
> > --------------
> > <shameless_author_plug>
> > Professional .NET for Java Developers with C#
> > ISBN:1-861007-91-4
> > Professional Windows Forms
> > ISBN: 1861005547
> > Professional JSP 2nd Edition
> > ISBN: 1861004958
> > Professional JSP
> > ISBN: 1861003625
> > Beginning JSP Web Development
> > ISBN: 1861002092
> > </shameless_author_plug>
> > --------------
> > "TJS" <nospam@.here.com> wrote in message
> > news:uXlUL2xrDHA.1764@.TK2MSFTNGP10.phx.gbl...
> > > I found a solution in cold fusion <cfftp>...
> > > works with about 20 lines of code !
> > > > you would think something as big as dotnet would have this too ?
> > > > > > > "John Timney (Microsoft MVP)" <timneyj@.despammed.com> wrote in message
> > > news:ekqLSIVrDHA.1928@.TK2MSFTNGP12.phx.gbl...
> > > > The Net framework SDK quickstart tutorials have examples of writing
> > > windows
> > > > services, and have http post examples too. I expect the help docs
in
> > > > vs.net cover the same material.
> > > > > > --
> > > > Regards
> > > > > > John Timney (Microsoft ASP.NET MVP)
> > > > --------------
> > > > <shameless_author_plug>
> > > > Professional .NET for Java Developers with C#
> > > > ISBN:1-861007-91-4
> > > > Professional Windows Forms
> > > > ISBN: 1861005547
> > > > Professional JSP 2nd Edition
> > > > ISBN: 1861004958
> > > > Professional JSP
> > > > ISBN: 1861003625
> > > > Beginning JSP Web Development
> > > > ISBN: 1861002092
> > > > </shameless_author_plug>
> > > > --------------
> > > > > > "TJS" <nospam@.here.com> wrote in message
> > > > news:Oz2ZRrUrDHA.2476@.tk2msftngp13.phx.gbl...
> > > > > do you know of any articles which may explain this in a bit more
> > detail
> > > ?
> > > > > > > > > > > "John Timney (Microsoft MVP)" <timneyj@.despammed.com> wrote in
> message
> > > > > news:eez77CHrDHA.2304@.TK2MSFTNGP11.phx.gbl...
> > > > > > The net classes can do form posts (even from within an asp.net
> > page).
> > > > > > Should you have a file on the server then you could post it to
> > another
> > > > > > server. This however is an ideal use for windows services as
they
> > > wont
> > > > > hog
> > > > > > your asp.net worker process while trying to do an upload. If
you
> do
> > > it
> > > > in
> > > > > > ASP, you have to work out how its going to happen as part of a
an
> > > intial
> > > > > > page request,or schedule the execution of the asp.net page.
> > > > > > > > > > --
> > > > > > Regards
> > > > > > > > > > John Timney (Microsoft ASP.NET MVP)
> > > > > > --------------
> > > > > > <shameless_author_plug>
> > > > > > Professional .NET for Java Developers with C#
> > > > > > ISBN:1-861007-91-4
> > > > > > Professional Windows Forms
> > > > > > ISBN: 1861005547
> > > > > > Professional JSP 2nd Edition
> > > > > > ISBN: 1861004958
> > > > > > Professional JSP
> > > > > > ISBN: 1861003625
> > > > > > Beginning JSP Web Development
> > > > > > ISBN: 1861002092
> > > > > > </shameless_author_plug>
> > > > > > --------------
> > > > > > > > > > "TJS" <nospam@.here.com> wrote in message
> > > > > > news:#v389w0qDHA.3616@.tk2msftngp13.phx.gbl...
> > > > > > > does asp.net have server to server file transfer (upload)
> > capability
> > > ?
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
Server Transfer doesnt Set Focus to Page
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...
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
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
> 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
> 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...
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
SearchResults.aspx and I want to pass a variable named strSearch.
So far I have:
Dim strSearch as string
strSearch = tbSearch.text
Server.Transfer("SearchBrowse.aspx?strSearch=" & strSearch ")
It is throwing this error:
Compiler Error Message: BC30648: String constants must end with a
double quote
I do not understand. Help anyone?Here's a nice, simple way to pass values from one page to another:
(VB.NET code)
'Add data to the context object before transferring
Context.Items("myParameter") = x
Server.Transfer("WebForm2.aspx")
Then, in WebForm2.aspx:
'Grab data from the context property
Dim x as Integer = CType(Context.Items("myParameter"),Integer)
Of course there are a number of ways to pass values from one page to
another, such as using the querystring, cookies, session,
context, saving to a temporary table in the database between each page, etc.
You'll have to decide which technique is best for your application.
Here are several good articles on the subject to help you decide.
http://msdn.microsoft.com/msdnmag/i...te/default.aspx
http://www.aspalliance.com/kenc/passval.aspx
http://www.dotnetbips.com/displayarticle.aspx?id=79
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Sparky Arbuckle" <twa@.secureroot.com> wrote in message
news:1108528696.261435.215090@.f14g2000cwb.googlegroups.com...
>I want to transfer to a search page from my default page to
> SearchResults.aspx and I want to pass a variable named strSearch.
> So far I have:
> Dim strSearch as string
> strSearch = tbSearch.text
> Server.Transfer("SearchBrowse.aspx?strSearch=" & strSearch ")
> It is throwing this error:
> Compiler Error Message: BC30648: String constants must end with a
> double quote
> I do not understand. Help anyone?
>
anyone else got any suggestions?
Hi,
Your Server.Transfer line should be: -
Server.Transfer("SearchBrowse.aspx?strSearch=" & strSearch)
HTH
regards
Joyjit
"Sparky Arbuckle" <twa@.secureroot.com> wrote in message
news:1108528696.261435.215090@.f14g2000cwb.googlegroups.com...
> I want to transfer to a search page from my default page to
> SearchResults.aspx and I want to pass a variable named strSearch.
> So far I have:
> Dim strSearch as string
> strSearch = tbSearch.text
> Server.Transfer("SearchBrowse.aspx?strSearch=" & strSearch ")
> It is throwing this error:
> Compiler Error Message: BC30648: String constants must end with a
> double quote
> I do not understand. Help anyone?
>
On 15 Feb 2005, "Sparky Arbuckle" <twa@.secureroot.com> postulated in
news:1108532798.517363.148550@.c13g2000cwb.googlegroups.com:
> anyone else got any suggestions?
>
Why the extra quote at the end of the line?
-- ip
Server Transfer
SearchResults.aspx and I want to pass a variable named strSearch.
So far I have:
Dim strSearch as string
strSearch = tbSearch.text
Server.Transfer("SearchBrowse.aspx?strSearch=" & strSearch ")
It is throwing this error:
Compiler Error Message: BC30648: String constants must end with a
double quote
I do not understand. Help anyone?Here's a nice, simple way to pass values from one page to another:
(VB.NET code)
'Add data to the context object before transferring
Context.Items("myParameter") = x
Server.Transfer("WebForm2.aspx")
Then, in WebForm2.aspx:
'Grab data from the context property
Dim x as Integer = CType(Context.Items("myParameter"),Integer)
Of course there are a number of ways to pass values from one page to
another, such as using the querystring, cookies, session,
context, saving to a temporary table in the database between each page, etc.
You'll have to decide which technique is best for your application.
Here are several good articles on the subject to help you decide.
http://msdn.microsoft.com/msdnmag/i...te/default.aspx
http://www.aspalliance.com/kenc/passval.aspx
http://www.dotnetbips.com/displayarticle.aspx?id=79
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Sparky Arbuckle" <twa@.secureroot.com> wrote in message
news:1108528696.261435.215090@.f14g2000cwb.googlegr oups.com...
>I want to transfer to a search page from my default page to
> SearchResults.aspx and I want to pass a variable named strSearch.
> So far I have:
> Dim strSearch as string
> strSearch = tbSearch.text
> Server.Transfer("SearchBrowse.aspx?strSearch=" & strSearch ")
> It is throwing this error:
> Compiler Error Message: BC30648: String constants must end with a
> double quote
> I do not understand. Help anyone?
anyone else got any suggestions?
Hi,
Your Server.Transfer line should be: -
Server.Transfer("SearchBrowse.aspx?strSearch=" & strSearch)
HTH
regards
Joyjit
"Sparky Arbuckle" <twa@.secureroot.com> wrote in message
news:1108528696.261435.215090@.f14g2000cwb.googlegr oups.com...
> I want to transfer to a search page from my default page to
> SearchResults.aspx and I want to pass a variable named strSearch.
> So far I have:
> Dim strSearch as string
> strSearch = tbSearch.text
> Server.Transfer("SearchBrowse.aspx?strSearch=" & strSearch ")
> It is throwing this error:
> Compiler Error Message: BC30648: String constants must end with a
> double quote
> I do not understand. Help anyone?
On 15 Feb 2005, "Sparky Arbuckle" <twa@.secureroot.com> postulated in
news:1108532798.517363.148550@.c13g2000cwb.googlegr oups.com:
> anyone else got any suggestions?
Why the extra quote at the end of the line?
-- ip
Server Transfer To Windows Forms Authenticated Application
I am having a really strange issue, I have folder containing an ASP.NET
application. (The folder's name is Web) The root directory of the whole
site I have an Index.aspx page that contains:
<%
Server.Transfer("Web\Default.aspx")
%
The web config file in the Web directory is using an Authentication mode of
Forms. For some reason when the transfer method is called, it thows an:
Parser Error Message: It is an error to use a section registered as
allowDefinition='MachineToApplication' beyond application level. This error
can be caused by a virtual directory not being configured as an application
in IIS.
I am running on a shared server, and can't really make it a virtual
directory. Does anyone know a way around this? Could I make it a subweb or
does this need to be a virtual directory?
Thanks.Hi Ryan,
what i understand from your description that u are maintaining a web.config
file in a sub dir also.
Actually Authenticate Mode can only be defined in the application wide
web.config file .
I suggest you remove the Authentication element from the web.config file and
then try running your application. In case you still find errors, try
removing the sessionState and authorization elements as well because they are
also set at application level.
In case you only wish to use Authentication mode as forms, you may have to
create a virtual dir.
HTH
"Ryan" wrote:
> Hello,
> I am having a really strange issue, I have folder containing an ASP.NET
> application. (The folder's name is Web) The root directory of the whole
> site I have an Index.aspx page that contains:
> <%
> Server.Transfer("Web\Default.aspx")
> %>
> The web config file in the Web directory is using an Authentication mode of
> Forms. For some reason when the transfer method is called, it thows an:
> Parser Error Message: It is an error to use a section registered as
> allowDefinition='MachineToApplication' beyond application level. This error
> can be caused by a virtual directory not being configured as an application
> in IIS.
> I am running on a shared server, and can't really make it a virtual
> directory. Does anyone know a way around this? Could I make it a subweb or
> does this need to be a virtual directory?
> Thanks.
server transfer to another site
same server and preserve the session state. I have played with
server.transfer but I get an error saying I can't do this. How can I
accomplish this. I don't think redirects with session state being passed in
the url makes any sense from a security standpoint.
--
BarryHow about a secure form post then to a page in the
other web app, carring session info and re-establishing
it?
"barryfz" <barry@.noemail.noemail> wrote in message
news:esTUn5IPGHA.3840@.TK2MSFTNGP14.phx.gbl...
> I need to be able to move from one web app on my server to another on the
> same server and preserve the session state. I have played with
> server.transfer but I get an error saying I can't do this. How can I
> accomplish this. I don't think redirects with session state being passed
in
> the url makes any sense from a security standpoint.
> --
> Barry
>
Server.Transfer does not affect the Session state as far as I know. Is
session what you meant ?. You can set a session var in one form, transfer to
form 2 and the variable will still be there in session.
Terry Burns
http://TrainingOn.net
"Raymond" <undsclsed@.nothee.net> wrote in message
news:wu0Nf.31433$pE4.25921@.trnddc04...
> How about a secure form post then to a page in the
> other web app, carring session info and re-establishing
> it?
>
> "barryfz" <barry@.noemail.noemail> wrote in message
> news:esTUn5IPGHA.3840@.TK2MSFTNGP14.phx.gbl...
> in
>
Terrry
I need to transfer to a page in a different site. I am getting an error
saying I can't do that in server.transfer. Maybe I am doing something wrong.
Barry
"Terry Burns" <me@.mine.com> wrote in message
news:u6UT8SJPGHA.3888@.TK2MSFTNGP12.phx.gbl...
> Server.Transfer does not affect the Session state as far as I know. Is
> session what you meant ?. You can set a session var in one form, transfer
> to form 2 and the variable will still be there in session.
> --
> Terry Burns
> http://TrainingOn.net
> "Raymond" <undsclsed@.nothee.net> wrote in message
> news:wu0Nf.31433$pE4.25921@.trnddc04...
>
What you are trying to do is unnatural. The main reason separate
applications exist is so they can maintain separate application state.
That said, there are ways to do it but they are not simple if you're dealing
with very much data. Its a very manual process to pass data between
applications. You can pass data via querystring or a common backend
database, etc.
I hope this helps,
Steve C. Orr
MCSD, MVP
http://SteveOrr.net
"barryfz" wrote:
> I need to be able to move from one web app on my server to another on the
> same server and preserve the session state. I have played with
> server.transfer but I get an error saying I can't do this. How can I
> accomplish this. I don't think redirects with session state being passed i
n
> the url makes any sense from a security standpoint.
> --
> Barry
>
>
Probably not if the domain is different. There may be
other ways to do it, but the simplest way is to redirect
via a form post and re-establish session using form post
data.
"Terry Burns" <me@.mine.com> wrote in message
news:u6UT8SJPGHA.3888@.TK2MSFTNGP12.phx.gbl...
> Server.Transfer does not affect the Session state as far as I know. Is
> session what you meant ?. You can set a session var in one form, transfer
to
> form 2 and the variable will still be there in session.
>
Barry,
As Steve and others may have pointed out, Server.Transfer only is designed
to work within the current IIS application.
What you would need to do if you do not want to pass session information on
the querystring or as hidden formfields is to set up a custom database or
other persistent storage mechanism to store and then retrieve by
"customSessionId" the information you need once the redirect lands on the ne
w
site.
Peter
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"barryfz" wrote:
> I need to be able to move from one web app on my server to another on the
> same server and preserve the session state. I have played with
> server.transfer but I get an error saying I can't do this. How can I
> accomplish this. I don't think redirects with session state being passed i
n
> the url makes any sense from a security standpoint.
> --
> Barry
>
>
Raymond,
I am not sure what you mean by domain? While these are different apps they
are on the same server, just different sites.
If I pass this a part of post don't I then allow someone to hijack the data
being posted and use it to gain access?
Barry
"Raymond" <undsclsed@.nothee.net> wrote in message
news:wO0Nf.31438$pE4.6074@.trnddc04...
> Probably not if the domain is different. There may be
> other ways to do it, but the simplest way is to redirect
> via a form post and re-establish session using form post
> data.
>
> "Terry Burns" <me@.mine.com> wrote in message
> news:u6UT8SJPGHA.3888@.TK2MSFTNGP12.phx.gbl...
> to
>
Steve,
I really just need to pass the authentication.
Barry
"Steve C. Orr" <Steve@.Orr.net> wrote in message
news:1E3F794F-B153-4CB8-BF01-B63832F89A4D@.microsoft.com...
> What you are trying to do is unnatural. The main reason separate
> applications exist is so they can maintain separate application state.
> That said, there are ways to do it but they are not simple if you're
> dealing
> with very much data. Its a very manual process to pass data between
> applications. You can pass data via querystring or a common backend
> database, etc.
> --
> I hope this helps,
> Steve C. Orr
> MCSD, MVP
> http://SteveOrr.net
>
> "barryfz" wrote:
>
Sorry, I misread you. This is correct, you cannot use server transfer to a
different site. Applications are isolated from each other and so a session
in one does not relate to a session in another. One way is to preserve the
session valriables in an SQL database but you need to serialie them for
storage and de-serialize them on retreival.
Terry Burns
http://TrainingOn.net
"barryfz" <barry@.noemail.noemail> wrote in message
news:OCDTjUJPGHA.3864@.TK2MSFTNGP10.phx.gbl...
> Terrry
> I need to transfer to a page in a different site. I am getting an error
> saying I can't do that in server.transfer. Maybe I am doing something
> wrong.
> Barry
>
> "Terry Burns" <me@.mine.com> wrote in message
> news:u6UT8SJPGHA.3888@.TK2MSFTNGP12.phx.gbl...
>
server transfer to another site
same server and preserve the session state. I have played with
server.transfer but I get an error saying I can't do this. How can I
accomplish this. I don't think redirects with session state being passed in
the url makes any sense from a security standpoint.
--
BarryHow about a secure form post then to a page in the
other web app, carring session info and re-establishing
it?
"barryfz" <barry@.noemail.noemail> wrote in message
news:esTUn5IPGHA.3840@.TK2MSFTNGP14.phx.gbl...
> I need to be able to move from one web app on my server to another on the
> same server and preserve the session state. I have played with
> server.transfer but I get an error saying I can't do this. How can I
> accomplish this. I don't think redirects with session state being passed
in
> the url makes any sense from a security standpoint.
> --
> Barry
Server.Transfer does not affect the Session state as far as I know. Is
session what you meant ?. You can set a session var in one form, transfer to
form 2 and the variable will still be there in session.
--
Terry Burns
http://TrainingOn.net
"Raymond" <undsclsed@.nothee.net> wrote in message
news:wu0Nf.31433$pE4.25921@.trnddc04...
> How about a secure form post then to a page in the
> other web app, carring session info and re-establishing
> it?
>
> "barryfz" <barry@.noemail.noemail> wrote in message
> news:esTUn5IPGHA.3840@.TK2MSFTNGP14.phx.gbl...
>> I need to be able to move from one web app on my server to another on
>> the
>> same server and preserve the session state. I have played with
>> server.transfer but I get an error saying I can't do this. How can I
>> accomplish this. I don't think redirects with session state being passed
> in
>> the url makes any sense from a security standpoint.
>> --
>> Barry
>>
>>
Terrry
I need to transfer to a page in a different site. I am getting an error
saying I can't do that in server.transfer. Maybe I am doing something wrong.
Barry
"Terry Burns" <me@.mine.com> wrote in message
news:u6UT8SJPGHA.3888@.TK2MSFTNGP12.phx.gbl...
> Server.Transfer does not affect the Session state as far as I know. Is
> session what you meant ?. You can set a session var in one form, transfer
> to form 2 and the variable will still be there in session.
> --
> Terry Burns
> http://TrainingOn.net
> "Raymond" <undsclsed@.nothee.net> wrote in message
> news:wu0Nf.31433$pE4.25921@.trnddc04...
>> How about a secure form post then to a page in the
>> other web app, carring session info and re-establishing
>> it?
>>
>>
>> "barryfz" <barry@.noemail.noemail> wrote in message
>> news:esTUn5IPGHA.3840@.TK2MSFTNGP14.phx.gbl...
>>> I need to be able to move from one web app on my server to another on
>>> the
>>> same server and preserve the session state. I have played with
>>> server.transfer but I get an error saying I can't do this. How can I
>>> accomplish this. I don't think redirects with session state being passed
>> in
>>> the url makes any sense from a security standpoint.
>>> --
>>> Barry
>>>
>>>
>>
>>
What you are trying to do is unnatural. The main reason separate
applications exist is so they can maintain separate application state.
That said, there are ways to do it but they are not simple if you're dealing
with very much data. Its a very manual process to pass data between
applications. You can pass data via querystring or a common backend
database, etc.
--
I hope this helps,
Steve C. Orr
MCSD, MVP
http://SteveOrr.net
"barryfz" wrote:
> I need to be able to move from one web app on my server to another on the
> same server and preserve the session state. I have played with
> server.transfer but I get an error saying I can't do this. How can I
> accomplish this. I don't think redirects with session state being passed in
> the url makes any sense from a security standpoint.
> --
> Barry
>
Probably not if the domain is different. There may be
other ways to do it, but the simplest way is to redirect
via a form post and re-establish session using form post
data.
"Terry Burns" <me@.mine.com> wrote in message
news:u6UT8SJPGHA.3888@.TK2MSFTNGP12.phx.gbl...
> Server.Transfer does not affect the Session state as far as I know. Is
> session what you meant ?. You can set a session var in one form, transfer
to
> form 2 and the variable will still be there in session.
Barry,
As Steve and others may have pointed out, Server.Transfer only is designed
to work within the current IIS application.
What you would need to do if you do not want to pass session information on
the querystring or as hidden formfields is to set up a custom database or
other persistent storage mechanism to store and then retrieve by
"customSessionId" the information you need once the redirect lands on the new
site.
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"barryfz" wrote:
> I need to be able to move from one web app on my server to another on the
> same server and preserve the session state. I have played with
> server.transfer but I get an error saying I can't do this. How can I
> accomplish this. I don't think redirects with session state being passed in
> the url makes any sense from a security standpoint.
> --
> Barry
>
Raymond,
I am not sure what you mean by domain? While these are different apps they
are on the same server, just different sites.
If I pass this a part of post don't I then allow someone to hijack the data
being posted and use it to gain access?
Barry
"Raymond" <undsclsed@.nothee.net> wrote in message
news:wO0Nf.31438$pE4.6074@.trnddc04...
> Probably not if the domain is different. There may be
> other ways to do it, but the simplest way is to redirect
> via a form post and re-establish session using form post
> data.
>
> "Terry Burns" <me@.mine.com> wrote in message
> news:u6UT8SJPGHA.3888@.TK2MSFTNGP12.phx.gbl...
>> Server.Transfer does not affect the Session state as far as I know. Is
>> session what you meant ?. You can set a session var in one form, transfer
> to
>> form 2 and the variable will still be there in session.
>>
Steve,
I really just need to pass the authentication.
Barry
"Steve C. Orr" <Steve@.Orr.net> wrote in message
news:1E3F794F-B153-4CB8-BF01-B63832F89A4D@.microsoft.com...
> What you are trying to do is unnatural. The main reason separate
> applications exist is so they can maintain separate application state.
> That said, there are ways to do it but they are not simple if you're
> dealing
> with very much data. Its a very manual process to pass data between
> applications. You can pass data via querystring or a common backend
> database, etc.
> --
> I hope this helps,
> Steve C. Orr
> MCSD, MVP
> http://SteveOrr.net
>
> "barryfz" wrote:
>> I need to be able to move from one web app on my server to another on
>> the
>> same server and preserve the session state. I have played with
>> server.transfer but I get an error saying I can't do this. How can I
>> accomplish this. I don't think redirects with session state being passed
>> in
>> the url makes any sense from a security standpoint.
>> --
>> Barry
>>
>>
>
Sorry, I misread you. This is correct, you cannot use server transfer to a
different site. Applications are isolated from each other and so a session
in one does not relate to a session in another. One way is to preserve the
session valriables in an SQL database but you need to serialie them for
storage and de-serialize them on retreival.
--
Terry Burns
http://TrainingOn.net
"barryfz" <barry@.noemail.noemail> wrote in message
news:OCDTjUJPGHA.3864@.TK2MSFTNGP10.phx.gbl...
> Terrry
> I need to transfer to a page in a different site. I am getting an error
> saying I can't do that in server.transfer. Maybe I am doing something
> wrong.
> Barry
>
> "Terry Burns" <me@.mine.com> wrote in message
> news:u6UT8SJPGHA.3888@.TK2MSFTNGP12.phx.gbl...
>> Server.Transfer does not affect the Session state as far as I know. Is
>> session what you meant ?. You can set a session var in one form, transfer
>> to form 2 and the variable will still be there in session.
>>
>> --
>> Terry Burns
>> http://TrainingOn.net
>> "Raymond" <undsclsed@.nothee.net> wrote in message
>> news:wu0Nf.31433$pE4.25921@.trnddc04...
>>> How about a secure form post then to a page in the
>>> other web app, carring session info and re-establishing
>>> it?
>>>
>>>
>>> "barryfz" <barry@.noemail.noemail> wrote in message
>>> news:esTUn5IPGHA.3840@.TK2MSFTNGP14.phx.gbl...
>>>> I need to be able to move from one web app on my server to another on
>>>> the
>>>> same server and preserve the session state. I have played with
>>>> server.transfer but I get an error saying I can't do this. How can I
>>>> accomplish this. I don't think redirects with session state being
>>>> passed
>>> in
>>>> the url makes any sense from a security standpoint.
>>>> --
>>>> Barry
>>>>
>>>>
>>>
>>>
>>
>>
If Authentication is all you need to worry about, then consider using
Windows Integrated Security, this way you wont need a username and password.
This is no use of course if the site is an internet site.
--
Terry Burns
http://TrainingOn.net
"barryfz" <barry@.noemail.noemail> wrote in message
news:utSOE1JPGHA.3460@.TK2MSFTNGP15.phx.gbl...
> Steve,
> I really just need to pass the authentication.
> Barry
>
> "Steve C. Orr" <Steve@.Orr.net> wrote in message
> news:1E3F794F-B153-4CB8-BF01-B63832F89A4D@.microsoft.com...
>> What you are trying to do is unnatural. The main reason separate
>> applications exist is so they can maintain separate application state.
>>
>> That said, there are ways to do it but they are not simple if you're
>> dealing
>> with very much data. Its a very manual process to pass data between
>> applications. You can pass data via querystring or a common backend
>> database, etc.
>>
>> --
>> I hope this helps,
>> Steve C. Orr
>> MCSD, MVP
>> http://SteveOrr.net
>>
>>
>>
>> "barryfz" wrote:
>>
>>> I need to be able to move from one web app on my server to another on
>>> the
>>> same server and preserve the session state. I have played with
>>> server.transfer but I get an error saying I can't do this. How can I
>>> accomplish this. I don't think redirects with session state being passed
>>> in
>>> the url makes any sense from a security standpoint.
>>> --
>>> Barry
>>>
>>>
>>>
You could always pass an encrypted string across.
-Adrian
"barryfz" <barry@.noemail.noemail> wrote in message
news:utSOE1JPGHA.3460@.TK2MSFTNGP15.phx.gbl...
> Steve,
> I really just need to pass the authentication.
> Barry
>
> "Steve C. Orr" <Steve@.Orr.net> wrote in message
> news:1E3F794F-B153-4CB8-BF01-B63832F89A4D@.microsoft.com...
>> What you are trying to do is unnatural. The main reason separate
>> applications exist is so they can maintain separate application state.
>>
>> That said, there are ways to do it but they are not simple if you're
>> dealing
>> with very much data. Its a very manual process to pass data between
>> applications. You can pass data via querystring or a common backend
>> database, etc.
>>
>> --
>> I hope this helps,
>> Steve C. Orr
>> MCSD, MVP
>> http://SteveOrr.net
>>
>>
>>
>> "barryfz" wrote:
>>
>>> I need to be able to move from one web app on my server to another on
>>> the
>>> same server and preserve the session state. I have played with
>>> server.transfer but I get an error saying I can't do this. How can I
>>> accomplish this. I don't think redirects with session state being passed
>>> in
>>> the url makes any sense from a security standpoint.
>>> --
>>> Barry
>>>
>>>
>>>
Default Sessions objects use cookies, which
are associated by URL domains, not server, on the client.
And each site on a server works in a different appdomain, so
the session objects aren't normally visible across those
appdomains even if you somehow figured out the client side
association.
If you pass session state info via a secure form post
then it's very secure. You're going to have to pass some
sort of associating data anyway, either by URL or form post.
There is no escaping that.
"barryfz" <barry@.noemail.noemail> wrote in message
news:%23MYjY0JPGHA.2796@.TK2MSFTNGP10.phx.gbl...
> Raymond,
> I am not sure what you mean by domain? While these are different apps they
> are on the same server, just different sites.
> If I pass this a part of post don't I then allow someone to hijack the
data
> being posted and use it to gain access?
> Barry
>
> "Raymond" <undsclsed@.nothee.net> wrote in message
> news:wO0Nf.31438$pE4.6074@.trnddc04...
> > Probably not if the domain is different. There may be
> > other ways to do it, but the simplest way is to redirect
> > via a form post and re-establish session using form post
> > data.
> > "Terry Burns" <me@.mine.com> wrote in message
> > news:u6UT8SJPGHA.3888@.TK2MSFTNGP12.phx.gbl...
> >> Server.Transfer does not affect the Session state as far as I know. Is
> >> session what you meant ?. You can set a session var in one form,
transfer
> > to
> >> form 2 and the variable will still be there in session.
> >>
Raymond,
Thanks for the feedbackon this. Can you clarify what you mean by a ":secure
post"?
Barry
"Raymond" <undsclsed@.nothee.net> wrote in message
news:eS1Nf.16048$fU6.5565@.trnddc08...
> Default Sessions objects use cookies, which
> are associated by URL domains, not server, on the client.
> And each site on a server works in a different appdomain, so
> the session objects aren't normally visible across those
> appdomains even if you somehow figured out the client side
> association.
> If you pass session state info via a secure form post
> then it's very secure. You're going to have to pass some
> sort of associating data anyway, either by URL or form post.
> There is no escaping that.
> "barryfz" <barry@.noemail.noemail> wrote in message
> news:%23MYjY0JPGHA.2796@.TK2MSFTNGP10.phx.gbl...
>> Raymond,
>>
>> I am not sure what you mean by domain? While these are different apps
>> they
>> are on the same server, just different sites.
>>
>> If I pass this a part of post don't I then allow someone to hijack the
> data
>> being posted and use it to gain access?
>>
>> Barry
>>
>>
>> "Raymond" <undsclsed@.nothee.net> wrote in message
>> news:wO0Nf.31438$pE4.6074@.trnddc04...
>> > Probably not if the domain is different. There may be
>> > other ways to do it, but the simplest way is to redirect
>> > via a form post and re-establish session using form post
>> > data.
>>>> > "Terry Burns" <me@.mine.com> wrote in message
>> > news:u6UT8SJPGHA.3888@.TK2MSFTNGP12.phx.gbl...
>> >> Server.Transfer does not affect the Session state as far as I know. Is
>> >> session what you meant ?. You can set a session var in one form,
> transfer
>> > to
>> >> form 2 and the variable will still be there in session.
>> >>
>>>>
>>
Form post via https. Passing all the session data that way
is the easiest. If SSL is not available, then consider passing
encrypted values using http form post and then decrypting on the
other end before re-creating the same session.
"barryfz" <barry@.noemail.noemail> wrote in message
news:%238%238Y6KPGHA.3732@.TK2MSFTNGP10.phx.gbl...
> Raymond,
> Thanks for the feedbackon this. Can you clarify what you mean by a
":secure
> post"?
> Barry
>
> "Raymond" <undsclsed@.nothee.net> wrote in message
> news:eS1Nf.16048$fU6.5565@.trnddc08...
> > Default Sessions objects use cookies, which
> > are associated by URL domains, not server, on the client.
> > And each site on a server works in a different appdomain, so
> > the session objects aren't normally visible across those
> > appdomains even if you somehow figured out the client side
> > association.
> > If you pass session state info via a secure form post
> > then it's very secure. You're going to have to pass some
> > sort of associating data anyway, either by URL or form post.
> > There is no escaping that.
> > "barryfz" <barry@.noemail.noemail> wrote in message
> > news:%23MYjY0JPGHA.2796@.TK2MSFTNGP10.phx.gbl...
> >> Raymond,
> >>
> >> I am not sure what you mean by domain? While these are different apps
> >> they
> >> are on the same server, just different sites.
> >>
> >> If I pass this a part of post don't I then allow someone to hijack the
> > data
> >> being posted and use it to gain access?
> >>
> >> Barry
> >>
> >>
> >> "Raymond" <undsclsed@.nothee.net> wrote in message
> >> news:wO0Nf.31438$pE4.6074@.trnddc04...
> >> > Probably not if the domain is different. There may be
> >> > other ways to do it, but the simplest way is to redirect
> >> > via a form post and re-establish session using form post
> >> > data.
> >> >> >> > "Terry Burns" <me@.mine.com> wrote in message
> >> > news:u6UT8SJPGHA.3888@.TK2MSFTNGP12.phx.gbl...
> >> >> Server.Transfer does not affect the Session state as far as I know.
Is
> >> >> session what you meant ?. You can set a session var in one form,
> > transfer
> >> > to
> >> >> form 2 and the variable will still be there in session.
> >> >>
> >> >> >>
> >>
That sounds feasible. What is "customSessionID"?
"Peter Bromberg [C# MVP]" <pbromberg@.yahoo.nospammin.com> wrote in message
news:BD99B17C-175B-4629-8D8A-4D20C75C6075@.microsoft.com...
> Barry,
> As Steve and others may have pointed out, Server.Transfer only is designed
> to work within the current IIS application.
> What you would need to do if you do not want to pass session information
> on
> the querystring or as hidden formfields is to set up a custom database or
> other persistent storage mechanism to store and then retrieve by
> "customSessionId" the information you need once the redirect lands on the
> new
> site.
> Peter
> --
> Co-founder, Eggheadcafe.com developer portal:
> http://www.eggheadcafe.com
> UnBlog:
> http://petesbloggerama.blogspot.com
>
>
> "barryfz" wrote:
>> I need to be able to move from one web app on my server to another on
>> the
>> same server and preserve the session state. I have played with
>> server.transfer but I get an error saying I can't do this. How can I
>> accomplish this. I don't think redirects with session state being passed
>> in
>> the url makes any sense from a security standpoint.
>> --
>> Barry
>>
>>
>
Hi Barry,
As for Server.Transfer, it can only work within a single ASP.NET
application but not across mutiple application or server bounary. Also,
session State is also not able to share between multiple applications. In
ASP.NET 2.0, there does provides interfaces for us to create customized
session storage provider(customzied session state httpmodule), however
that'll require quite complex work:
#Implementing a Session-State Store Provider
http://msdn2.microsoft.com/en-us/li...)/ms178587.aspx
BTW, if your applications are using ASP.NET forms Authentication and want
to share the forms authentication's autentication ticket(cookie based)
across multiple applications, you can have a look at the following
reference:
#How To Share Authentication Cookies across ASP.NET V1.1 and ASP.NET V2.0
Applications
http://weblogs.asp.net/scottgu/arch.../10/432851.aspx
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.)
Thanks Raymond,
I can do that, but couldn't someone grab the post and resend it from their
own brower and thus hijack the session?
Barry
"Raymond" <undsclsed@.nothee.net> wrote in message
news:vJ3Nf.31459$pE4.23999@.trnddc04...
> Form post via https. Passing all the session data that way
> is the easiest. If SSL is not available, then consider passing
> encrypted values using http form post and then decrypting on the
> other end before re-creating the same session.
>
> "barryfz" <barry@.noemail.noemail> wrote in message
> news:%238%238Y6KPGHA.3732@.TK2MSFTNGP10.phx.gbl...
>> Raymond,
>>
>> Thanks for the feedbackon this. Can you clarify what you mean by a
> ":secure
>> post"?
>>
>> Barry
>>
>>
>> "Raymond" <undsclsed@.nothee.net> wrote in message
>> news:eS1Nf.16048$fU6.5565@.trnddc08...
>> > Default Sessions objects use cookies, which
>> > are associated by URL domains, not server, on the client.
>> > And each site on a server works in a different appdomain, so
>> > the session objects aren't normally visible across those
>> > appdomains even if you somehow figured out the client side
>> > association.
>>> > If you pass session state info via a secure form post
>> > then it's very secure. You're going to have to pass some
>> > sort of associating data anyway, either by URL or form post.
>> > There is no escaping that.
>>> > "barryfz" <barry@.noemail.noemail> wrote in message
>> > news:%23MYjY0JPGHA.2796@.TK2MSFTNGP10.phx.gbl...
>> >> Raymond,
>> >>
>> >> I am not sure what you mean by domain? While these are different apps
>> >> they
>> >> are on the same server, just different sites.
>> >>
>> >> If I pass this a part of post don't I then allow someone to hijack the
>> > data
>> >> being posted and use it to gain access?
>> >>
>> >> Barry
>> >>
>> >>
>> >> "Raymond" <undsclsed@.nothee.net> wrote in message
>> >> news:wO0Nf.31438$pE4.6074@.trnddc04...
>> >> > Probably not if the domain is different. There may be
>> >> > other ways to do it, but the simplest way is to redirect
>> >> > via a form post and re-establish session using form post
>> >> > data.
>> >>> >>> >> > "Terry Burns" <me@.mine.com> wrote in message
>> >> > news:u6UT8SJPGHA.3888@.TK2MSFTNGP12.phx.gbl...
>> >> >> Server.Transfer does not affect the Session state as far as I know.
> Is
>> >> >> session what you meant ?. You can set a session var in one form,
>> > transfer
>> >> > to
>> >> >> form 2 and the variable will still be there in session.
>> >> >>
>> >>> >>> >>
>> >>
>>>>
>>
Thanks Steven,
I think this is what I am looking for.
Barry
"Steven Cheng[MSFT]" <stcheng@.online.microsoft.com> wrote in message
news:YuKvpPPPGHA.2972@.TK2MSFTNGXA03.phx.gbl...
> Hi Barry,
> As for Server.Transfer, it can only work within a single ASP.NET
> application but not across mutiple application or server bounary. Also,
> session State is also not able to share between multiple applications. In
> ASP.NET 2.0, there does provides interfaces for us to create customized
> session storage provider(customzied session state httpmodule), however
> that'll require quite complex work:
> #Implementing a Session-State Store Provider
> http://msdn2.microsoft.com/en-us/li...)/ms178587.aspx
> BTW, if your applications are using ASP.NET forms Authentication and want
> to share the forms authentication's autentication ticket(cookie based)
> across multiple applications, you can have a look at the following
> reference:
> #How To Share Authentication Cookies across ASP.NET V1.1 and ASP.NET V2.0
> Applications
> http://weblogs.asp.net/scottgu/arch.../10/432851.aspx
> 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.)
>
>
>
Well, what's to prevent them from doing that now
with the sessions you have going now from the same
site? The transfer as I outlined doesn't add any new
vulnerability. If a hijaking vulnarability already exists
for the sessions on the same site, it'll also exist for the
cross-site transfer.
"barryfz" <barry@.noemail.noemail> wrote in message
news:OaGEwCTPGHA.648@.TK2MSFTNGP14.phx.gbl...
> Thanks Raymond,
> I can do that, but couldn't someone grab the post and resend it from their
> own brower and thus hijack the session?
> Barry
>
> "Raymond" <undsclsed@.nothee.net> wrote in message
> news:vJ3Nf.31459$pE4.23999@.trnddc04...
> > Form post via https. Passing all the session data that way
> > is the easiest. If SSL is not available, then consider passing
> > encrypted values using http form post and then decrypting on the
> > other end before re-creating the same session.
> > "barryfz" <barry@.noemail.noemail> wrote in message
> > news:%238%238Y6KPGHA.3732@.TK2MSFTNGP10.phx.gbl...
> >> Raymond,
> >>
> >> Thanks for the feedbackon this. Can you clarify what you mean by a
> > ":secure
> >> post"?
> >>
> >> Barry
> >>
> >>
> >> "Raymond" <undsclsed@.nothee.net> wrote in message
> >> news:eS1Nf.16048$fU6.5565@.trnddc08...
> >> > Default Sessions objects use cookies, which
> >> > are associated by URL domains, not server, on the client.
> >> > And each site on a server works in a different appdomain, so
> >> > the session objects aren't normally visible across those
> >> > appdomains even if you somehow figured out the client side
> >> > association.
> >> >> > If you pass session state info via a secure form post
> >> > then it's very secure. You're going to have to pass some
> >> > sort of associating data anyway, either by URL or form post.
> >> > There is no escaping that.
> >> >> > "barryfz" <barry@.noemail.noemail> wrote in message
> >> > news:%23MYjY0JPGHA.2796@.TK2MSFTNGP10.phx.gbl...
> >> >> Raymond,
> >> >>
> >> >> I am not sure what you mean by domain? While these are different
apps
> >> >> they
> >> >> are on the same server, just different sites.
> >> >>
> >> >> If I pass this a part of post don't I then allow someone to hijack
the
> >> > data
> >> >> being posted and use it to gain access?
> >> >>
> >> >> Barry
> >> >>
> >> >>
> >> >> "Raymond" <undsclsed@.nothee.net> wrote in message
> >> >> news:wO0Nf.31438$pE4.6074@.trnddc04...
> >> >> > Probably not if the domain is different. There may be
> >> >> > other ways to do it, but the simplest way is to redirect
> >> >> > via a form post and re-establish session using form post
> >> >> > data.
> >> >> >> >> >> >> > "Terry Burns" <me@.mine.com> wrote in message
> >> >> > news:u6UT8SJPGHA.3888@.TK2MSFTNGP12.phx.gbl...
> >> >> >> Server.Transfer does not affect the Session state as far as I
know.
> > Is
> >> >> >> session what you meant ?. You can set a session var in one form,
> >> > transfer
> >> >> > to
> >> >> >> form 2 and the variable will still be there in session.
> >> >> >>
> >> >> >> >> >> >>
> >> >>
> >> >> >>
> >>
Barry, I would suggest that you re-think the problem if possible, this is
not really a good way to go about it. I realize sometimes this is not
possible for various reasons, but if there is any way around it, you should
think hard about it.
--
Terry Burns
http://TrainingOn.net
"barryfz" <barry@.noemail.noemail> wrote in message
news:%23gpoyKTPGHA.532@.TK2MSFTNGP15.phx.gbl...
> Thanks Steven,
> I think this is what I am looking for.
> Barry
>
> "Steven Cheng[MSFT]" <stcheng@.online.microsoft.com> wrote in message
> news:YuKvpPPPGHA.2972@.TK2MSFTNGXA03.phx.gbl...
>> Hi Barry,
>>
>> As for Server.Transfer, it can only work within a single ASP.NET
>> application but not across mutiple application or server bounary. Also,
>> session State is also not able to share between multiple applications. In
>> ASP.NET 2.0, there does provides interfaces for us to create customized
>> session storage provider(customzied session state httpmodule), however
>> that'll require quite complex work:
>>
>> #Implementing a Session-State Store Provider
>> http://msdn2.microsoft.com/en-us/li...)/ms178587.aspx
>>
>> BTW, if your applications are using ASP.NET forms Authentication and want
>> to share the forms authentication's autentication ticket(cookie based)
>> across multiple applications, you can have a look at the following
>> reference:
>>
>> #How To Share Authentication Cookies across ASP.NET V1.1 and ASP.NET V2.0
>> Applications
>> http://weblogs.asp.net/scottgu/arch.../10/432851.aspx
>>
>> 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.)
>>
>>
>>
>>
>>
>>
>>
>>
>>
Thanks for Terry's input,
Hi Barry,
I think Terry's suggestion is reasonable, we should think it over to
determine whether using such cross-authentication is necessary. If we can
use other approach or design to avoid it, that'll be preferred.
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.)
Here is my problem. I have a DNN portal site and an eCommerce site that is
not a DNN module. I really do not have the resources available to recode
the eCommerce site to make it DNN comliant. Up until now we have not had DNN
content that requried any security so we deferred security to the eCommerce
site entirely. Now I am being asked to add content to the DNN site that
will require security but we don't want to make our customers log on twice,
once for DNN adn once for eCommerce. I need to come up with a way to handle
a single sign on for both sites. I have requeste info from MS about using
Passport but I need to assess all alternatives.
Any suggestions are mor than welcome.
Barry
"Steven Cheng[MSFT]" <stcheng@.online.microsoft.com> wrote in message
news:IIjfLnZPGHA.6432@.TK2MSFTNGXA03.phx.gbl...
> Thanks for Terry's input,
> Hi Barry,
> I think Terry's suggestion is reasonable, we should think it over to
> determine whether using such cross-authentication is necessary. If we can
> use other approach or design to avoid it, that'll be preferred.
> 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.)
Actually, passport would have been my suggestion if you could not work
around. I think its your best option by the sounds of things,
Good luck
--
Terry Burns
http://TrainingOn.net
"barryfz" <barry@.noemail.noemail> wrote in message
news:u0i2T2fPGHA.3508@.TK2MSFTNGP10.phx.gbl...
> Here is my problem. I have a DNN portal site and an eCommerce site that
> is not a DNN module. I really do not have the resources available to
> recode the eCommerce site to make it DNN comliant. Up until now we have
> not had DNN content that requried any security so we deferred security to
> the eCommerce site entirely. Now I am being asked to add content to the
> DNN site that will require security but we don't want to make our
> customers log on twice, once for DNN adn once for eCommerce. I need to
> come up with a way to handle a single sign on for both sites. I have
> requeste info from MS about using Passport but I need to assess all
> alternatives.
> Any suggestions are mor than welcome.
> Barry
>
> "Steven Cheng[MSFT]" <stcheng@.online.microsoft.com> wrote in message
> news:IIjfLnZPGHA.6432@.TK2MSFTNGXA03.phx.gbl...
>> Thanks for Terry's input,
>>
>> Hi Barry,
>>
>> I think Terry's suggestion is reasonable, we should think it over to
>> determine whether using such cross-authentication is necessary. If we can
>> use other approach or design to avoid it, that'll be preferred.
>>
>> 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.)
>>
Server Transfer doesn't Set Focus to Page
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.
>
Server Transfer vs Response.redirect.
Ok, maybee this is a silly question but...
What is the main difference between using a Server.Transfer command and a Response.Redirect?
And when should I use what?
Regards
Ola.
Take a look at the following article:
Server.Transfer vs. Response.Redirect
HTH
Thanks, this is usefull to know.
Regards
Ola
Server Transfer To Windows Forms Authenticated Application
I am having a really strange issue, I have folder containing an ASP.NET
application. (The folder's name is Web) The root directory of the whole
site I have an Index.aspx page that contains:
<%
Server.Transfer("Web\Default.aspx")
%>
The web config file in the Web directory is using an Authentication mode of
Forms. For some reason when the transfer method is called, it thows an:
Parser Error Message: It is an error to use a section registered as
allowDefinition='MachineToApplication' beyond application level. This error
can be caused by a virtual directory not being configured as an application
in IIS.
I am running on a shared server, and can't really make it a virtual
directory. Does anyone know a way around this? Could I make it a subweb or
does this need to be a virtual directory?
Thanks.Hi Ryan,
what i understand from your description that u are maintaining a web.config
file in a sub dir also.
Actually Authenticate Mode can only be defined in the application wide
web.config file .
I suggest you remove the Authentication element from the web.config file and
then try running your application. In case you still find errors, try
removing the sessionState and authorization elements as well because they ar
e
also set at application level.
In case you only wish to use Authentication mode as forms, you may have to
create a virtual dir.
HTH
"Ryan" wrote:
> Hello,
> I am having a really strange issue, I have folder containing an ASP.NET
> application. (The folder's name is Web) The root directory of the whole
> site I have an Index.aspx page that contains:
> <%
> Server.Transfer("Web\Default.aspx")
> %>
> The web config file in the Web directory is using an Authentication mode o
f
> Forms. For some reason when the transfer method is called, it thows an:
> Parser Error Message: It is an error to use a section registered as
> allowDefinition='MachineToApplication' beyond application level. This erro
r
> can be caused by a virtual directory not being configured as an applicatio
n
> in IIS.
> I am running on a shared server, and can't really make it a virtual
> directory. Does anyone know a way around this? Could I make it a subweb
or
> does this need to be a virtual directory?
> Thanks.
>