Frameset Issue

G

Guest

Hi,

I am using a frameset in an aspx page, like so:


<Frameset id="Frameset" BORDER="0" ROWS="350,3%" HEIGHT="100%"
FRAMEBORDER="0" FRAMESPACING="0"

runat="server">

<frame id="srcFrame" SRC="repheader.aspx" frameborder="0" runat="server" />

<frame id="docFrame" name="docFrame" HEIGHT="80%" runat="server" />

</Frameset>




and in the srcFrame I have a link button that calls another aspx page. I
want the aspx page to show up in the docFrame not the srcFrame. I use a
redirect in my link button to bring up the other aspx page but need it to be
shown in the docFrame instead. How do I do this?

Thanks,

JJ
 
C

Curt_C [MVP]

you cant. You cant specify a TARGET from codebehind. You'll have to do it
with a clientside call, like an HREF where you can specify it
 
K

Ken Dopierala Jr.

Hi JJ,

In the code behind for your link button add something like this:

lnkButton.Attributes.Add("onclick",
"parent.document.getElementById('docFrame').src = 'OtherPage.aspx'; return
false;")

That should change the docFrame for you. I usually use normal buttons so if
there are any differences for link buttons it might not work. Specifically
I don't know if you need to "return false;" to stop the link button from
changing your page. Also if a link button works like an <a href=""> tag
then you could probably just put "Javascript:
parent.document.getElementById('docFrame').src = 'OtherPage.aspx';" for the
href arguement in your HTML and not even mess around with adding an
Attribute to the button. Either way you should be able to work it out from
there. Good luck! Ken.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top