Redirect to target _parent from codebehind

  • Thread starter Thread starter MB
  • Start date Start date
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
 
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
 
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."
 
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
 
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."
 
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."
 
Back
Top