• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1108
  • Last Modified:

How to open new page in 2nd iframe from datagrid link button click in the 1st iframe

Hi,
The web form MainForm.aspx  has image button. In the onclick event of the image button I am calling the vbscript function.
   Function openmodaldialogfunction
         myPopUp =  window.showModalDialog("iFrame.aspx","","dialogHeight: 350px;dialogWidth: 550px;status:no;" )
   End Function

In the Frame1.aspx I have iframe markup is there.src="Search.aspx"

<body MS_POSITIONING="GridLayout">
            <form id="Form1" method="post" runat="server">
                  <iframe id="frame1" height="100%" width="100%" src="Search.aspx" frameborder="1" scrolling="no">
                  </iframe>
                  
            </form>
      </body>


The Search.aspx has a Data Grid.It is showing the search results in the Grid.The Grid has link button.It is firing the DataGridItem command event.In that event I want to open another page in another iframe.

 Protected Sub DGSearch_ItemCommand(ByVal source As System.Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DGSearch.ItemCommand
        If e.CommandName.Equals("Select") Then
            Dim strBatch As String
            Dim lkBtn As LinkButton
            lkBtn = CType(e.Item.FindControl("lnkbtn"), LinkButton)
         
            strInfo = lkBatch.Text
            Dim strStart As String =  strInfo.Substring(0, 4)
            Dim strEnd As String = strInfo.Substring(4, 4)
           
            Response.Redirect("Search2.aspx?StartStr=" + strStart + "&EndStr=" + strEnd )
           
        End If
    End Sub


Now I am just redirecting it Search2.aspx.Search2.aspx showing the result Grid in the same frame.I want to open the Search2.apsx in another frame frame2

In brief this is happening
MainForm.aspx - image button click - search.aspx dispalying in iframe in the frame.aspx

Search.aspx -Datagrid item command event - search2.aspx displaying in frame.aspx. I want it display in frame2.aspx

Please let me know how to do this.

Thanks.
0
KavyaVS
Asked:
KavyaVS
1 Solution
 
guru_samiCommented:
Redirect will do the redirect and not open a new window.

Two ways...
1: You can add onclick event to your linkButton and open the Search.aspx the same way you are doing it on MainForm Image click

or
2: Inject javascript codeblock from you itemCommand. Use window.open. Here's how you can do that.
0
 
KavyaVSAuthor Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now