Redirect to target _parent from codebehind

M

MB

Hello!

I am using a frameset and vb codebehind to work with a database.
When pressing a delete button in one of my frames, I want the hole application to be refreshed, or at least another of my frames to be refreshed. I don't really understand how to do this.

I tried with response.redirect("Frameset1.htm") but I can't set target frame _parent for this command.
I regular <a href="Frameset1.htm" target="_parent">test</a> would solve my problem, but I want to do this from codebehind and not by letting the user click more than the delete button.

How could I solve this issue?

Regards Magnus
 
N

Natty Gur

Hi,

Use Page RegisterStartupscript to embed javascript that change other
frame src.

Natty Gur, CTO
Dao2Com Ltd.
34th Elkalay st. Raanana
Israel , 43000
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377
 
M

MSFT

Hi Magnus,

I think you only need call some client side JScript to the refresh the
frames. For example to refresh the whole page (all Frames):

window.parent.location="...."

To refresh a particular frame:

window.parent.frames("FrameID").location="..."

Luke

"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026?? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
http://www.microsoft.com/security/security_bulletins/ms03-026.asp and/or to
visit Windows Update at http://windowsupdate.microsoft.com to install the
patch. Running the SCAN program from the Windows Update site will help to
insure you are current with all security patches, not just MS03-026."
 
M

MB

Thank you!

Unfortunately I'm not sop familiar with asp.net environment so I wonder how
to call this from a vb codebehind function.

Regards Magnus
 
M

MSFT

Hi Magnus,

You can write the script to client side with RegisterStartupScript for
example:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click


Dim strClientScript As String

strClientScript = "<script language=JavaScript> "

strClientScript +=
"window.parent.frames(""AnotherFrame"").location=""\Another.aspx"" "

strClientScript += " </script>"


Me.RegisterStartupScript("ddd", strClientScript)

End Sub

Luke

"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026?? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
http://www.microsoft.com/security/security_bulletins/ms03-026.asp and/or to
visit Windows Update at http://windowsupdate.microsoft.com to install the
patch. Running the SCAN program from the Windows Update site will help to
insure you are current with all security patches, not just MS03-026."
 
M

MSFT

There is no namespace needed. You can refer to its document in MSDN:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemwebuipageclassregisterstartupscripttopic.asp

Luke

"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026?? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
http://www.microsoft.com/security/security_bulletins/ms03-026.asp and/or to
visit Windows Update at http://windowsupdate.microsoft.com to install the
patch. Running the SCAN program from the Windows Update site will help to
insure you are current with all security patches, not just MS03-026."
 
Joined
Mar 11, 2008
Messages
1
Reaction score
0
Use response.write

I usually use this code, or something alike, when the response.redirect isn't enough, use this for redirecting the parent frame. I presume you are using VB.NET ASP.

Code:
Response.Write("<SCRIPT>parent.location='URL'</SCRIPT>")

It simply posts javascript on top of the html output.

(Now, this thread is very old, but it has a tendency to show up on google still.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top