TipsOnLips.net

Your .net tips and tricks source

About the author

Author Name is someone.
E-mail me Send mail

Recent comments

Authors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010


JavaScript ToolTips resources

  1. Nice Titles revised
  2. 40+ Tooltips Scripts With AJAX, JavaScript & CSS 
  3. Pure CSS Tooltips
  4. DHTML Goodies
  5. Advanced Tooltip Control - ASP.NET AJAX
  6. ASP.NET Tooltip control 
  7. Tooltip a DIV through DOM/Javascript

Categories: JavaScript
Posted by developer on Friday, March 20, 2009 3:40 PM
Permalink | Comments (0) | Post RSSRSS comment feed

ASP.NET RegisterStartupScript - HOW-To

if (!this.Page.IsClientScriptBlockRegistered("hideMessage"))
{ this.Page.RegisterStartupScript("hideMessage", 
	"<script>document.getElementById('" + pnlMessage.ClientID + "').style.display = 
				 'none'</script>;"); }


Categories: ASP.NET | C# | CSS | HowTo | JavaScript
Posted by Admin on Wednesday, March 18, 2009 7:57 AM
Permalink | Comments (0) | Post RSSRSS comment feed

ASP.NET Refresh Page using JavaScript

Examples 

<asp:Button ID="btnNewSearch" runat="server" OnClientClick="javascript:location.reload();" Text="New Search" />

or

<input type="button" value="Reload Page" onClick="window.location.reload()">

<input type="button" value="Reload Page" onClick="history.go(0)">

<input type="button" value="Reload Page" onClick="window.location.href">
 


Tags: ,
Categories: ASP.NET | JavaScript
Posted by Admin on Sunday, March 15, 2009 4:32 AM
Permalink | Comments (0) | Post RSSRSS comment feed

ASP.NET Response.Write and Ajax ScriptManager.RegisterStartupScript

To show a message box from the ASP.NET page code behind, we could try to ways:

  1. When no Ajax is used:

    • Response.Write("<script>alert('The Class has been created.');</script>");

  2. When Ajax is used:

    • ScriptManager.RegisterStartupScript(this, this.GetType(), "Key", String.Format("alert('The {0} Class has been approved.');", Detail.Title), true);


Categories: Ajax | ASP.NET | JavaScript
Posted by Admin on Saturday, March 07, 2009 8:57 AM
Permalink | Comments (0) | Post RSSRSS comment feed

Reporting Services 2005 Jump to URL using JavaScript

When using Reporting Services reports, if there was a need for a link to jump to another page in a new window target='_blank' (as the default behaviou is target='_top'), then we need to add the following java script to a report text box by right clicking the text box or control that has the url and then select the Navigation tab and then the select the Jump to URL radio button.


I was only able to get this working in Reporting Services 2005 without any issue, as it did not work with the 2000 version.  


 ="javascript: var f = window.open('" & Parameters!YourUrl.Value & "/Path/Default.aspx?ParameterID=" &   Parameters!Parameter1ID.Value & " ')"


Posted by Admin on Thursday, December 06, 2007 9:29 AM
Permalink | Comments (10) | Post RSSRSS comment feed

Disable browser Back or Enter keyboard keys using JavaScript

function disableEnter()

    {

        //Disables the BackSpace button.

        if (event.keyCode == 13)

        {

            event.cancelBubble = true;

            event.returnValue = false;

        } [more]

    }

   

    function disableBack()

    {

        //Disables the BackSpace button.

        if (event.keyCode == 8)

        {

            event.cancelBubble = true;

            event.returnValue = false;

        }

    }


Categories: JavaScript
Posted by developer on Thursday, August 30, 2007 11:50 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Register a JavaScript file programmatically (ASP.NET)

 To register a js programmatically, use the following:Page.ClientScript.RegisterClientScriptInclude("script1", ResolveUrl("~/include/js/javascriptfile.js"));.

This can live behinde the master page inside the load event.

//Its better to check if the script was registered (Page.ClientScript.IsClientScriptBlockRegistered("script1")). 

Also, you can use another way if you have more script to register which in sequence:

 

      if(!IsPostBack && !Page.ClientScript.IsClientScriptBlockRegistered("URLs"))

        {

         StringBuilder scriptBuilder = new StringBuilder();

         scriptBuilder.Append("<script type='text/javascript' src='");    

         scriptBuilder.Append(ResolveUrl("~/include/js/mmloadmenus2.js"));

         scriptBuilder.Append("'></script>");        

         scriptBuilder.Append("<script type='text/javascript' src='");

         scriptBuilder.Append(ResolveUrl("~/include/js/mm_menu.js"));        

         scriptBuilder.Append("'></script>");

         scriptBuilder.Append("<script language='JavaScript1.2'>mmLoadMenus();</script>");

        Page.ClientScript.RegisterClientScriptBlock(typeof(System.String),"URLs",

        scriptBuilder.ToString());

   }


Categories: ASP.NET | JavaScript
Posted by Admin on Thursday, August 16, 2007 11:05 PM
Permalink | Comments (0) | Post RSSRSS comment feed

A javascript link can be used to call a javascript function as below:

A javascript link can be used to call a javascript function as below:

<a href="javascript:;" onclick="openWindow('../../Pages/Help/PopupForms/SelectDisplayType.aspx')">

<img src="../../images/icons/question_sm.gif" border="0" tabindex="-1" />

</a>


Categories: JavaScript
Posted by developer on Monday, August 13, 2007 4:46 AM
Permalink | Comments (0) | Post RSSRSS comment feed