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

Frames and response.redirect

P: n/a
Hi,
I really need som help here.
I have read a lot of thread about Frames ans response.redirect and I know by
now that I cannot use response redirect and I have to use "some kind of
javascript on the client side" according to a lot of answers. The only
answers that have some code did not seem to work with my code?

I have a login page (with no frame) and when the program accepts the login
the page is redirected to a page with 3 frames. On the header frame there is
a logout button. In the codebehind I am suppose to abandon the session and to
redirect to the Login page (the one with no frames). Here is the code behind
the logout button:
FormsAuthentication.SignOut()
Session.Abandon()
<Here I am suppose to redirect to the login page>

How Can I solve this problem?
Can anybody help me?

Thanks
PKin
--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...p-net/200510/1
Nov 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
I have no idea if this works, but i would think that it would. With that
said, you said that you have to use javascript to change go to wherever it
is you need to go. Couldn't you do something like the following? -

FormsAuthentication.SignOut()
Session.Abandon()
Response.Write(script)

where script would be a string of something like
"<script>window.location.href = bla</script>". (I don't know what the
javascript for the command would be so I doubt what i put would work).

I would think that that would work, but again I don't know for sure. Just
an idea.

-Darren Kopp
http://blog.secudocs.com/
"PKin via DotNetMonster.com" <u10324@uwe> wrote in message
news:5595d79be947c@uwe...
Hi,
I really need som help here.
I have read a lot of thread about Frames ans response.redirect and I know
by
now that I cannot use response redirect and I have to use "some kind of
javascript on the client side" according to a lot of answers. The only
answers that have some code did not seem to work with my code?

I have a login page (with no frame) and when the program accepts the login
the page is redirected to a page with 3 frames. On the header frame there
is
a logout button. In the codebehind I am suppose to abandon the session and
to
redirect to the Login page (the one with no frames). Here is the code
behind
the logout button:
FormsAuthentication.SignOut()
Session.Abandon()
<Here I am suppose to redirect to the login page>

How Can I solve this problem?
Can anybody help me?

Thanks
PKin
--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...p-net/200510/1

Nov 19 '05 #2

P: n/a
This can only be done by using Java script on the client side.

In the page displaying in the header frame do the following:
Up top in the class declare a variable to be used by the Java script,
something like:
Protected m_TargetPageTxt As String = ""
In the postback code of the Logout button, do your stuff, BUT instead of
re-direct, insert the following statement, telling the Java script to
re-direct:
m_TargetPageTxt = "LoginForm.aspx"
Note - use the name of your login form.

In the page itself displaying in the header frame, go into HTML view and
right at the bottom paste this Java script
<script language="javascript">
var TargetPageTxt = '<%=m_TargetPageTxt%>';
if (TargetPageTxt != "") {
window.top.navigate(TargetPageTxt);
}
</script>
"PKin via DotNetMonster.com" <u10324@uwe> wrote in message
news:5595d79be947c@uwe...
Hi,
I really need som help here.
I have read a lot of thread about Frames ans response.redirect and I know
by
now that I cannot use response redirect and I have to use "some kind of
javascript on the client side" according to a lot of answers. The only
answers that have some code did not seem to work with my code?

I have a login page (with no frame) and when the program accepts the login
the page is redirected to a page with 3 frames. On the header frame there
is
a logout button. In the codebehind I am suppose to abandon the session and
to
redirect to the Login page (the one with no frames). Here is the code
behind
the logout button:
FormsAuthentication.SignOut()
Session.Abandon()
<Here I am suppose to redirect to the login page>

How Can I solve this problem?
Can anybody help me?

Thanks
PKin
--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...p-net/200510/1

Nov 19 '05 #3

P: n/a
Hi Chris,
Your solution works very nice. Thanks.

Pkin
--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...p-net/200510/1
Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.