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,036 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

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 article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

737 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