Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Accessing components on other pages

Reply
Thread Tools

Accessing components on other pages

 
 
CJ
Guest
Posts: n/a
 
      12-09-2005
I have a page with a bunch of iframes (which make up a tab control).
At least one of these iframes contains an aspx page, which in turn
contains a .ascx component. This component then contains a datagrid.

Is there any way that I can access this datagrid from one of the other
iframes? The grid contains a template column containing checkboxes, and
I need to access the rows for which the checkbox is selected from this
other iframe. Since it's a templatecolumn, I can't just put the
underlying dataset in the session state and retrieve it from the other
page; I *could* maintain a second dataset containing just the selected
rows, which I update whenever a checkbox's state changes, but that just
seems incredibly slow and clumsy.

Is there any way I can do this?

 
Reply With Quote
 
 
 
 
John Timney \( MVP \)
Guest
Posts: n/a
 
      12-09-2005
You can talk between pages and compontents using javascript at the client
side, as long as you dont subject the browser to a cross site scripting
attack which is what normally happens when communciating between iframes.
Theres a good example of talking to an iframe from within a page here that
should get you started.

http://www.dyn-web.com/dhtml/iframes/

You cant talk to a iframes content if its not from the same domain, only to
the iframe object.

See:
http://msdn.microsoft.com/workshop/a...g_security.asp

iFrames are a pain to work with, you might be better off using divs.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"CJ" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
>I have a page with a bunch of iframes (which make up a tab control).
> At least one of these iframes contains an aspx page, which in turn
> contains a .ascx component. This component then contains a datagrid.
>
> Is there any way that I can access this datagrid from one of the other
> iframes? The grid contains a template column containing checkboxes, and
> I need to access the rows for which the checkbox is selected from this
> other iframe. Since it's a templatecolumn, I can't just put the
> underlying dataset in the session state and retrieve it from the other
> page; I *could* maintain a second dataset containing just the selected
> rows, which I update whenever a checkbox's state changes, but that just
> seems incredibly slow and clumsy.
>
> Is there any way I can do this?
>



 
Reply With Quote
 
 
 
 
CJ
Guest
Posts: n/a
 
      12-09-2005
The page I want to access the grid from is also an asp.net page, so it
doesn't have to be clientside access; in fact, it *shouldn't* be
because I need to pass the selected items from the grid to another .net
method running on the server. So I guess the question is, from within
an asp.net page, can I access a datagrid in an asp.net custom control
on a different asp.net page, which sits within an iframe within a third
asp.net page?

Put like that, it sounds rather hopeless.

I know that iframes are a pain to work with; unfortunately it's a
project that I've inherited so I don't have much choice. Thanks for
the links, they might not help to solve this problem but they should
help me understand iframes better!

John Timney ( MVP ) wrote:
> You can talk between pages and compontents using javascript at the client
> side, as long as you dont subject the browser to a cross site scripting
> attack which is what normally happens when communciating between iframes.
> Theres a good example of talking to an iframe from within a page here that
> should get you started.
>
> http://www.dyn-web.com/dhtml/iframes/
>
> You cant talk to a iframes content if its not from the same domain, only to
> the iframe object.
>
> See:
> http://msdn.microsoft.com/workshop/a...g_security.asp
>
> iFrames are a pain to work with, you might be better off using divs.
>
> --
> Regards
>
> John Timney
> ASP.NET MVP
> Microsoft Regional Director
>
> "CJ" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) oups.com...
> >I have a page with a bunch of iframes (which make up a tab control).
> > At least one of these iframes contains an aspx page, which in turn
> > contains a .ascx component. This component then contains a datagrid.
> >
> > Is there any way that I can access this datagrid from one of the other
> > iframes? The grid contains a template column containing checkboxes, and
> > I need to access the rows for which the checkbox is selected from this
> > other iframe. Since it's a templatecolumn, I can't just put the
> > underlying dataset in the session state and retrieve it from the other
> > page; I *could* maintain a second dataset containing just the selected
> > rows, which I update whenever a checkbox's state changes, but that just
> > seems incredibly slow and clumsy.
> >
> > Is there any way I can do this?
> >


 
Reply With Quote
 
John Timney \( MVP \)
Guest
Posts: n/a
 
      12-09-2005
This is very hard to do server side, as you have to capture the output of
any page before its rendered and delivered - in order of execution.

Have a read of Riks blog for an example of capturing page output and see eif
you can work out a way of making the server side access work.
http://west-wind.com/weblog/posts/481.aspx

The difficulty will probably be in ensuring the pipeline renders the pages
in the correct order.



John Timney
ASP.NET MVP
Microsoft Regional Director

"CJ" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> The page I want to access the grid from is also an asp.net page, so it
> doesn't have to be clientside access; in fact, it *shouldn't* be
> because I need to pass the selected items from the grid to another .net
> method running on the server. So I guess the question is, from within
> an asp.net page, can I access a datagrid in an asp.net custom control
> on a different asp.net page, which sits within an iframe within a third
> asp.net page?
>
> Put like that, it sounds rather hopeless.
>
> I know that iframes are a pain to work with; unfortunately it's a
> project that I've inherited so I don't have much choice. Thanks for
> the links, they might not help to solve this problem but they should
> help me understand iframes better!
>
> John Timney ( MVP ) wrote:
>> You can talk between pages and compontents using javascript at the client
>> side, as long as you dont subject the browser to a cross site scripting
>> attack which is what normally happens when communciating between iframes.
>> Theres a good example of talking to an iframe from within a page here
>> that
>> should get you started.
>>
>> http://www.dyn-web.com/dhtml/iframes/
>>
>> You cant talk to a iframes content if its not from the same domain, only
>> to
>> the iframe object.
>>
>> See:
>> http://msdn.microsoft.com/workshop/a...g_security.asp
>>
>> iFrames are a pain to work with, you might be better off using divs.
>>
>> --
>> Regards
>>
>> John Timney
>> ASP.NET MVP
>> Microsoft Regional Director
>>
>> "CJ" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed) oups.com...
>> >I have a page with a bunch of iframes (which make up a tab control).
>> > At least one of these iframes contains an aspx page, which in turn
>> > contains a .ascx component. This component then contains a datagrid.
>> >
>> > Is there any way that I can access this datagrid from one of the other
>> > iframes? The grid contains a template column containing checkboxes, and
>> > I need to access the rows for which the checkbox is selected from this
>> > other iframe. Since it's a templatecolumn, I can't just put the
>> > underlying dataset in the session state and retrieve it from the other
>> > page; I *could* maintain a second dataset containing just the selected
>> > rows, which I update whenever a checkbox's state changes, but that just
>> > seems incredibly slow and clumsy.
>> >
>> > Is there any way I can do this?
>> >

>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing other Frames components carmelo Java 2 10-02-2009 09:08 AM
accessing global class from other pages Daves ASP .Net 6 03-21-2005 03:06 PM
SWING components adjustment in different resolutions - Should show scrollbars less than 800X600 and expand components over this resolution Bluetears76 Java 1 07-01-2004 09:01 PM
Can Choice components respond to keyboard input like HTML Choice components? Mickey Segal Java 0 02-02-2004 10:59 PM
Accessing DCOM components from the code behind pages and using sessions to store DCOM object handles Alex ASP .Net 3 12-02-2003 01:34 AM



Advertisments