Solved

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

Posted on 2013-01-25
2
1,030 Views
Last Modified: 2013-02-11
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
Comment
Question by:KavyaVS
2 Comments
 
LVL 41

Accepted Solution

by:
guru_sami earned 500 total points
ID: 38819482
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
 

Author Closing Comment

by:KavyaVS
ID: 38877320
Thanks
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question