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,012 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now