?
Solved

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

Posted on 2013-01-25
2
Medium Priority
?
1,060 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 1500 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

Video: Liquid Web Managed WordPress Comparisons

If you run run a WordPress, you understand the potential headaches you may face when updating your plugins and themes. Do you choose to update on the fly and risk taking down your site; or do you set up a staging, keep it in sync with your live site and use that to test updates?

Question has a verified solution.

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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Suggested Courses

771 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