Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Watching data

Author  Topic 

elwoos
Master Smack Fu Yak Hacker

2052 Posts

Posted - 2005-09-12 : 11:50:05
Hello

I have a page that is used to enter data onto my database.

The problem I have is this - the users need to enter a code which they quite often won't know, but is available on another website which they can search.

To make life easier for them I was wondering if I could display some of this site on my page so that the users can simply copy and paste as appropriate. An Iframe would be ideal but I can find no way of changing the source for this programatically.

Ideally I don't want an extra window or a popup and was wondering if anyone had any suggestions. I'd like to use the current text boxes to search the website and show the results so that they can just be copied.

Does anyone have any ideas/suggestions on how this may be accomplished?

thanks

steve

Alright Brain, you don't like me, and I don't like you. But lets just do this, and I can get back to killing you with beer.

MichaelP
Jedi Yak

2489 Posts

Posted - 2005-09-12 : 11:57:48
You MAY be able to programatically change the Iframe destination with some rendered javascript....

I'm not sure if the security stuff will let you do that though...

Michael

<Yoda>Use the Search page you must. Find the answer you will. Cursors, path to the Dark Side they are. Avoid them, you must. Use Order By NewID() to get a random record you will.</Yoda>
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-09-12 : 12:08:18
if it's just one website you don't even need to change the destination.


Go with the flow & have fun! Else fight the flow
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2005-09-13 : 05:48:53
Can you "scrape" the other site and save them having to cut&paste it at all? (I'm sure you would have thought of that if it was doable, so sorry if granny+eggs)

Kristen
Go to Top of Page

elwoos
Master Smack Fu Yak Hacker

2052 Posts

Posted - 2005-09-14 : 06:57:58
Hi Kristen, I had thought of that but I wasn't sure it was worth the effort to locate the bits I need. Maybe I should take another look at it

thanks guys

steve

Facts are meaningless. You could use facts to prove anything that's even remotely true!
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-09-14 : 07:19:41
You definitely can use JavaScript as Michael suggests, I do this all the time (but not in .Net). Something like:

-Create an IFRAME <iframe src="mysite.aspx" name="site" id="site"></iframe>, MAKE SURE it has the Name attribute set
-Attach a JavaScript code block to your page, or simply include it somewhere in the ASPX code, containing the following:

<script language="JavaScript">
function changesite() { window.frames["site"].location="myOtherSite.aspx"; }
</script>


You can also use JavaScript to pass info between the two pages (if they're on the same web domain) but the pages have to be written a certain way.
Go to Top of Page
   

- Advertisement -