how can i get the effect that when u point over a link an information is shown in a box which tells u what that link does.
its like when you hover over a link a box explains its action.
Can some1 help me out with a neat sample.
do i need to use the ajax - hovermenuextender for this??
Thanks
It depends on how fancy you want to be. I personally have found jQuery (AKA JavaScript) to answer the call here. qTip is a jQuery library that has some amazing pop-up "bubble" effects. Head over to their website and check out the various things you can do.
If you head to the qTip documentation (particularly this page), you can see how easy it is to replace "normal" link pop-ups with a much better looking tool tip. Code example shown below:
$('a[title]').qtip({ style: { name: 'cream', tip: true } })
Since you are using ASP.NET you could use ASPNET ToolTip; hover over the bulleted items in the link to see examples.
Related
I copied some code from here to make an extension compatible with Visual Studio 2019 to replace the built-in outlining because it does not collapse the curly braces in catch & finally block.
Now the extension works fine as the picture shows below.
But there is only one thing I'm not satisfied with. When I move the mouse to the collapsed part, it just shows plain text tooltip without any color or format.
I would like to make the tooltip look like the built-in one. But I don't know where to start.
I did some research about this. I may need to change the hoverText in this code.
return new TagSpan<IOutliningRegionTag>(span, new OutliningRegionTag(false, false, GetCollapsedText(), hoverText));
I think it might involve with Classification, ITooltipService or something else.
I'm new to this, could anyone give me some advice? Some demo code or document would be great help. Thanks.
Code is here: CSharpOutline2019
After a night long research, I finally found a solution and achieved my goal.
In case anyone would be interested with this question, I'll try to exlpain how it works, giving a general idea.
Import IProjectionBufferFactoryService to create the hover TextBuffer
Import ITextEditorFactoryService to create a IWpfTextView to show the hover content
Replace the parameter hoverText with IWpfTextView in the code I mentioned above
return new TagSpan<IOutliningRegionTag>(span, new OutliningRegionTag(false, false, GetCollapsedText(), hoverText));
That's pretty much it. And I found the solution here.
The extension works great, the tooltip looks just the same as the default one.
The complete code will be uploaded to CSharpOutline2019 soon.
I am writing Coded UI Test's for a web app. I am having problems such as I record actions using the test builder, however sometimes the button that is clicked has different information each time I run the test and as result VS can't find the button.
The html code never changes so what I want to do is find the button by its html code and click it that way.
For example on Google the path to the search button is
<button id="gbqfba" aria-label="Google Search" name="btnK" class="gbqfba"><span id="gbqfsa">Google Search</span></button>
How can I click this button using the code above or Alternativly using the XPath
//*[#id="gbqfba"]
Any help would be greatly appreciated.
adjust the Search Properties and Filter Properties.
Something like:
$('button span').each(function(){
If($(this).html() == "Google Search")
{
$(this).parent('button').click();
}
});
I found the answer, If you go to the UIMap.uitest file and click the method you have the problem with you can change the filter properties and the search properties to remove parts that are failing your test.
This will do the trick:
BrowserWindow.ExecuteScript("$('#gbqfba').click();");
Okay lets say the page contains a link called 'About Us'. Instead of me doing:
webBrowser.Navigate ("www.page.com/aboutus");
...how can I tell my program to click any link that contains the text About Us?
I know this might seem like Im doing more work then necessary I have too but trust me I need this bit of code.
Any help would be appreciated, thanks :)
You need to find the HtmlElement object for the <a> tag, then call InvokeMember("click").
If the element has an ID, you can get it by calling Document.GetElementById; otherwise, you can look through GetElementsByTagName and find the element you're looking for.
On my master page (for all pages in my site) I have a ToolkitScriptManager.
On my content page, there are a series of hyperlinks and divs for collapsible functionality.
The code to show/hide the panels work like the following:
$(document).ready(function() {
// Hookup event handlers and execute HTML DOM-related code
$('#nameHyperLink').click(function() {
var div = $('#nameDiv');
var link = $('#nameHyperLink');
if (div.css('display') == 'none') {
link.text('Hide Data');
div.show('100');
}
else {
link.text('Show Data');
div.hide('100');
}
});
});
If I include a ScriptReference to the jQuery 1.4.2 file in the toolkitscriptmanager, the javascript code is executed incorrectly on the page (only the text for the hyperlink is changed, the div is not actually shown.) However, if I don't include the jQuery file in the ToolkitScriptManager and instead include it in the content page, it works correctly.
I'm a Javascript/jQuery newbie, and this makes no sense at all. What's going on here?
Positioning of the script include is important for the jQuery ref. If you look at your generated source I would bet the tag is below the script function(). You should make sure that the jQuery reference comes as early as you can get it in the page source.
Try moving the jQuery library reference into the head of your master page, that should work. Otherwise post up some source!
Like Tj says... should probably be in the head section of your master page. Also, it's nice to link to Google's version of this library, because chances are your users will already have it cached. For instance, look at the source for this very page.
The two most probable causes here are $ not being defined yet (see Tj's answer) and $ getting defined by another library, such as prototype.
I would highly suggest you look into using Firebug's javascript debugger, or at least take a look at Firefox's built in error console (Tools -> Error console). That will give you a much better clue what is going on other than "it's not working."
Im new into that asp.net thing, but here goes.
I got at ImageButton, and when its clicked i want the image displayed in another window. If I can avoid using ajax i would like to do that.
If possible would like to make the window modal, but still avoid ajax, since Im not ready to mix more technolgies yet.
The existing answers with JavaScript are fine, but just to suggest an alternative - could you use a HyperLink (with an ImageUrl set so you still get an image) and set its Target property instead?
IMHO the best practice to show a picture is in the same page on the top of the content. I personally use Lightbox. You can find the documentation on their page, so it should be easy for you to integrate their JavaScript code.
Somewhat like this:
<asp:ImageButton ID="imbJoin" CssClass="btn-find" AlternateText="Find" ToolTip="Find" runat="server" ImageUrl="~/library/btn-find.gif" onClick="javascript:popUp("ServicesLocator.aspx")" />
Resource: http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_22832169.html
Using the ImageButton you need to use a JavaScript to open it in a new window. You can also look into the OnClientClick-event
You can use the ImageButton's OnClientClick property:
<asp:ImageButton ... OnClientClick="javascript:window.open('url_to_image');" >
But this popup window will not be modal.
The following javascript will do what you're looking for:
window.open('page.html','WindowTitle','width=400,height=200')
It might be worth pointing to a two relevant entries in the excellent EFNet's #javascript FAQ:
Correct Use of Popups - yay accessibility!
How do I make a popup window the same size as my image?
How do I create a custom 'OK' dialog or something similar? - modal windows are not that useful and something like the suggested Lightbox or similar scripts would be better "modal" options
Correct Use of Links - this one being only partly on-topic but the previous answers use of the "javascript:" pseudo protocol made it necessary: it is never required nor useful in a web page that should work across browsers. After all, JavaScript is the default (and only) scripting language.
Thank you for all the answers! I ended up using lightbox
I found this example
http://neutrongenious.wordpress.com/2007/09/08/lightbox-for-asp-net-2-0/
And it works perfectly