Postback of one frame in response to click of a image button in another frame in the same page(Note:-Both frames there are 2 different aspx page but in a same page page using 2 frames)

Hi all,

I am having a C# coded page with 2 different frames in it.This 2 frames contain each an aspx file.So the functionality am trying is I have image buttons in one frame .So when i click that image button the other frame i have should load with a specified image in it.

I tried redirecting it but that happens only in the first frame where the image buttons are.Resulted in showing the 2 frames in the first frame.

I am stuck in this for almost a day.Please can anyone help regarding this?.

Regards,

Joseph

0
jsphbasil
4/8/2009 11:47:12 AM
asp.net.web-forms 93655 articles. 5 followers. Follow

7 Replies
2322 Views

Similar Articles

[PageSpeed] 41

look into the Target attribute of the anchor:

for example:

<a href="http://www.CyberJetX.com" target="MyOtherFrame">Visit CyberJetX</a>

More details here http://www.w3schools.com/tags/att_a_target.asp 

hth


Joe Johnston
If a picture is worth a 1000 words, a sample application is worth a 1000 blog entries
Remember the Constitution!
Dont forget to mark posts answered and resolved (if they are)
0
khaos
4/8/2009 2:06:48 PM

Thanks for your reply.But as i have metinoned those are image buttons and when i click those it should just load a particular picture in the other frame.

 

0
jsphbasil
4/8/2009 2:20:20 PM

jsphbasil:

Thanks for your reply.But as i have metinoned those are image buttons and when i click those it should just load a particular picture in the other frame.

This works:

<a href=http://www.CyberJetX.com/images/myCoolImage.jpg target="MyOtherFrame">Show An Image in a Frame</a>

 


Joe Johnston
If a picture is worth a 1000 words, a sample application is worth a 1000 blog entries
Remember the Constitution!
Dont forget to mark posts answered and resolved (if they are)
0
khaos
4/8/2009 2:57:27 PM

I forgot to mention something those are dynamically created image buttons

0
jsphbasil
4/8/2009 3:41:50 PM

Whatever you told does work for text.But if i try to do that for an image i doesnt work.Can you please help further?

0
jsphbasil
4/9/2009 8:42:16 AM

jsphbasil:

Whatever you told does work for text.But if i try to do that for an image i doesnt work.Can you please help further?

You should look into abandoning the image button for the hyperlink.  I think you can get the results you want with far less fuss.  If you must have imagebuttons you will need to look into javascript and you will need to add it when you create the controls using ctrl.attributes.add

I dont know how to do it since I no longer use frames. Note the code below is dynamic and uses images as buttons.

        override protected void OnInit(EventArgs e)
        {
            // Create dynamic controls here.
            // Use "using System.Web.UI.WebControls;"
            hl = new HyperLink();
            hl.ID = "hl1";
            hl.ImageUrl = "http://static.asp.net/NeuAvatarHttpHandler.ashx?username=khaos&forceidenticon=False";
            hl.NavigateUrl = "http://www.rabittooth.com/1024x768StarWarsWallpapers2/DarthYoda1024.jpg";
            hl.Target = "MyFrame";
            form1.Controls.Add(hl);
            
            hl = new HyperLink();
            hl.ID = "hl2";
            hl.ImageUrl = "http://static.asp.net/asp.net/images/people/anonymous.gif";
            hl.NavigateUrl = "http://static.asp.net/asp.net/images/people/anonymous.gif";
            hl.Target = "MyOtherFrame";
            form1.Controls.Add(hl);

            base.OnInit(e);
        }
 HTH,
Joe Johnston
If a picture is worth a 1000 words, a sample application is worth a 1000 blog entries
Remember the Constitution!
Dont forget to mark posts answered and resolved (if they are)
0
khaos
4/9/2009 2:47:34 PM

Thank you very much.That helped me a lot.Now i am able to get the functionality which is required.Thanks a bunch

0
jsphbasil
4/14/2009 11:09:42 AM
Reply:

Similar Artilces:

How to open Response.Redirect("default.aspx") on whole page in page with frames and not in a specific frame?
Hi, I got page with frames.. I want to open default.aspx in whole page, not in a specific frame. how to do it? Thanks, gil. I tried this: Response.Redirect("default.aspx") but it opens on the main frame and not on the whole page. What to do?   One question are you using the redirect inside the frame?,"Mark As Answer" If my reply helped you -- have a look on this thread belowhttp://forums.asp.net/p/1187451/2032032.aspx Regards,Vinz"Code, Beer and Music" that's my way of being a programmer!How to get your Forum Question Answered | Blog | CodeA...

Update controls from one page to another aspx page on a frame
Hello, I've a frame page called default.aspx that has a left panel as navigation and the content page. When I first start the application, the content page is loaded with login.aspx page for user to login, however, when I first load the default.aspx page, I would like all controls (hylerlink and button) on the left panel be disabled until the user is loggin. So my question is that how do write script to enable the left navigation page one the user successfully authenicated. Which mean updating controls of another page. Is it possible? Thanks,...

show new page when i use frames to render pages and showed in one part of my main page
Hello Mate,i have a main page.in which i am showing folder names (in my project)(right hand side) and when i click a particular folder name, it will show links for web pages in that particular folder.now when i click links it will render using frames those pages and show them in a div tag.So only the second part(left hand side) of my main page will get redirected based on the links that we are clicking.in my error page i have a back button which redirects the user to the login screen.the problem is the error page is also getting rendered through the frames. so the error page is shown in the ...

load frame inside a aspx page which is using master page
Hi I am using master page within my application. I have a requirement to use  iframe. This frame works upon the click event of an html button. I am clueless how to load that frame. If i dont use master page then i can load it as:document.frmReportGenerator.target ="FRMRESULST";document.frmReportGenerator.action="ShowData.aspx"; document.frmReportGenerator.submit(); But now as i am nt using forms... how to implement the above written statements? Please help me as soon as possible. Thanx & regards, DiseirraDiseirraMark it as an answer, if it helped you anyh...

How to load DocViewer.aspx page into the content frame when a link button 'lbtViewDoc' in "Menu' frame is clicked?
I have two frames with the following names:  'ContentFrame'  and 'MenuFrame'. I have a link button whos id is 'lbtViewDoc' that is in 'MenuFrame'. I want the DocViewer.aspx to get loaded into 'ContentFrame' when the link button 'lbtViewDoc' in 'MenuFrame'  is clicked. Note that we have a link button and not a hyperlink.Can someone  tell me how I can do this?sun21170 Utilize the linkbuttons Click event to write out some javascript which will reload the other frame with your pagevoid LinkButton_Click(Object sender, EventArgs e)      ...

JavaScript function to take a page from within a framed website and remove the frames to display a logged out page.
I need a JavaScript function to take a page from within a framed website and remove the frames to display a logged out page.  Allan Horwitz <script type="text/javascript"> <!-- if (top.location != self.location) top.location = self.location // --> </script>Allan Horwitz...

Paging Paging Paging
I am trying to do paging with my search results and it isnt working very well. Here is what I've tried and I feel I've tried everything, lol, please help me out. Sub DataGrid1_SortCommand(Sender as object, e as DataGridSortCOmmandEventArgs) DataGrid1.DataBind() End Sub Sub Datagrid1_PageIndexChanged(Sender as object, e as DataGridPageChangedEventArgs) Dim ds as dataSet DataGrid1.CurrentPageIndex = e.NewPageIndex if Session("Search") is nothing then 'Session probably has expired, get the datasource from database Datagrid1.DataSource = ...

How do I create a frame for one content page that shows a url of an html page of a completely different site
I am trying to feed the address of a residence into a script and then load google maps into a frame that will pop-op and show the map.  How dod I do that? The javascript window.open() method should work for you.C# <---> VB.Net Translator Thanks for the reply.  I just noticed it. I assume that I use the onClientClick event for the control, and if so how do I feed the following in to it strAddress = (http://www.website & Adress.text & "%2C%20" & City.text & "%2c%20" & State.text& "%20" & ZipCode.text) I ...

Search in Page with frames always starts in first frame, also if I select a frame with the mouse
Name: Alexander Nussbaumer Email: alexander.nussbaumer_at_uni-graz.at Product: Firefox Summary: Search in Page with frames always starts in first frame, also if I select a frame with the mouse Comments: Searching ("Find in This Page", Ctrl-F) starts in the first frame. I would propose, if I select a frame, then the search for words should start in this selected frame. For example, if I search a word in the Java API documentation page, the search starts in the left menu frames. However, I would need to start the search in the bigger frame on the right side. Jav...

load page in frame on page load
Hello is it possible on an event PageLoad to load a page in a frame. I tried many things but it stil coms to that i have to use a butten instead   tnx   Sure, we did this a while back. When you setup your frame give the one that you need to change out a name. In ours it was id='BottomContent'. Then on the Page_Load or any other event that you may need use the code below.(Just replace .BottomContent with the name that you gave to your frame) Response.Write("<script type='text/javascript'>parent.BottomContent.location='www.theurlyouwanttoload.com';</script>");It'...

using response.write window.open to show a aspx page in another frame
All i am doing is when i click a record in datagrid it has to show that related record in another frame, all i pass is the session values of the recordid. this is what is happening: First time when i click the row link in datagrid, it shows the related record perfectly in that frame. now again if i click another link under datagrid row, the page in the frame which hasd the previous record is not getting refreshed and nopt showing the link record which i am suppose to see. it is showing the same old record. Its only working for the first time, if i click it again thats when it is fai...

Convert a page with frames in a page with divs
I'm trying to convert the frames and framesets from a web page in divs. I make this function, but the new divs don't have the same position than the frames and frameset. Is there any propierty that contains the position of a frame in the window? Thank you. This is my code: function changeframetodiv(){ fra = content.document.getElementsByTagName("frame") divnew= content.document.createElement("div") for(i=0;i<fra.length;i++) { divn = content.document.createElement("div") divn.innerHTML=fra[i].contentDocument.getElementsByTagNa...

Refresh frame and pages inside the frame
I have an asp.net app., with a few webforms. In a button click event on a webform(current page) I have code to update a particular file, restart the webapplication(by loading and saving the web.config file). Then to refresh the current page and come back to it, I use: Response.Write("<script>window.location.href=window.location.href +'?newpage=1';</script>"); But, the current page is inside a frame, how do I modify the above code to refresh the frame and in the frame maintain the page in the left frame in the state it was before the applicatio...

How to display two or more pages on one page wihout frames or masterpage?
Hi. My web page is built with frames to display header with menu in header part of a page and main part for displaing different pages. But I have a problem with firefox which doesn't display frames correctly. Because in main part of my page I want to display pages from other people's web sites I can't use ASP MasterPage technic. Is there other technic to display two or more pages on one page without using frames or masterpages? Regards Pawel. Have you tried IFrame?Erik van Ballegoij, The Netherlands Thanks for your repaly ErikVB. I didn't use IFra...

Web resources about - Postback of one frame in response to click of a image button in another frame in the same page(Note:-Both frames there are 2 different aspx page but in a same page page using 2 frames) - asp.net.web-forms

Resources last updated: 1/19/2016 10:51:48 AM