Hi all.
I have an iframe in an asp.net web page (Display.aspx). - <iframe id="iframe1" runat="server" src="temp/test.html"></iframe>
Now I need to highlight a search text, say 'test' in the Display.aspx page. The source of iframe is dynamically assigned and search text is also changeable. This means I am dealing with dynamic search text and html page. Please suggest me how could I highlight the search texts in the iframe placed in the asp.net web page.
Thanks in advance. Happy Programming!
4 6827 Frinavale 9,735
Recognized Expert Moderator Expert
Have you considered using JavaScript to solve this problem?
-Frinny
Hi,
I have used jquery highlighter. It is highlighting the words in the aspx page. But I am unable to highlight the search words within the html files embedded in the aspx page.
We can embed an html file into an aspx page in various ways, using Response.WriteF ile or Server.Transfer or using iframe also. In all these methods, I have been unable to highlight the words in the html file. Any idea please? Thank you.
Dormilich 8,658
Recognized Expert Moderator Expert
if the text to be highlighted is in the iframe, it could be that the Javascript is not loaded or the text not accessed. Frames (resp. their content) in any way are separate HTML pages! (though there are ways for Javascript to interact between pages)
since asp is executed on the server (right?) this reduces to a frame-javascript problem.
PS: I gave up on frames long ago, so you might have to ask in the Javascript forum for the appropriate solution
acoder 16,027
Recognized Expert Moderator MVP
To get access to the iframe document, there are one or two differences: contentDocument says W3C and the standards-compliant browsers, and contentWindow.d ocument according to IE. So, try something like this: - if (iframeObj.contentDocument) doc = iframeObj.contentDocument;
-
else if (iframeObj.contentWindow) doc = iframeObj.contentWindow.document;
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: leegold2 |
last post by:
Commonly done, eg. you enter a word in a search engine and when a
hit-page comes up the search word(s) are highlighted.
I'm doing a fulltext search that works well but I've tried a few
"packaged scripts" and haven't got one to work yet. I'm looking for
straightforward understandable way to do this on my MYSQL/PHP pages.
Thanks,
Lee
|
by: David Morgan |
last post by:
Hello
I have a little function to highlight text if it exists.
Function Highlight(vFind, vSearch)
Dim RegEx
Set RegEx = New RegExp
RegEx.Pattern = vFind
RegEx.IgnoreCase = True
Highlight = RegEx.Replace(vSearch, "<span class=""Highlight"">" & vFind &
|
by: tungchau81 |
last post by:
Hi,
A Modal Dialog does not allow us to highlight the text content inside
<DIV> tag unless I use a <textarea> tag to display that text content.
However, the situation of my software makes it impossible to use
<textarea> and Modeless dialog. I am really stuck!!!
Is there any trick to make <DIV> or <SPAN>'s content be selectable in a
Modal dialog?
Thanks in advance,
|
by: Nicky |
last post by:
hi, all
I have an iframe in my page. Actually what I want is just like the google
search.
When user clicks search, I will load the a page from another URL into iframe
and then highlight the key words in the iframe.
Does anyone know how to do this? By JS or VBScript?
Thanks
|
by: hrpreet |
last post by:
Hi All,
On click of a link , the contents get displayed in an iframe.
Is there a way to search some text in the content displayed in the
iframe and highlight it.
Thanks.
| |
by: Savvas |
last post by:
Hi,
I am using VB.Net 2005 for a windows application. The application was
actually upgraded from vb.net 2003.
I have a search field which is used as a parameter to search all
datagrid columns. According to this parameter, the dataset and datagrid
shows only the columns where the search parameter applies. The code is
|
by: Celeste |
last post by:
Hello,
I'm trying to parse the referring url for google search terms so that when this page loads it will scroll to and highlight the search term(s). Should i be using document.referrer?
Please take a look at my code and tell me what i'm doing wrong:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>highlight</title>
|
by: Merlin1857 |
last post by:
A thing I have been asked for on a number of occasions is the ability to highlight text after its been searched for in a record return page. The following does this perfectly.
Use this function within your record return page :
'Highlight searched for text function
Function Highlight(strText, strFind, strBefore, strAfter)
Dim nPos
Dim nLen
|
by: yogarajan |
last post by:
Dear Friends
i am devloping for search box it is woking good i want highlight my search text. My original text is Mixed case (Lower case and upper case) my search text is lower case means how can i highlight
it is possible? pls guide me
Example
Content : "The previous installments in this article series have demonstrated how to display, group, sort, and page through data using the ListView control. In addition to displaying data, the...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |