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


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 XML Desinger call Web.Config entry

To call a Web.Config appSettings entry from the ASP.NET XML Desinger (not the code behind) then,

call "<%$ appSettings:WEB_SERVICE_URL_SEARCH %>"

or

"<%$ connectionString:DATABASE_CONNECTION_STRING_NAME %>".  


Categories: ASP.NET
Posted by Admin on Tuesday, March 17, 2009 4:09 PM
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 Disable Submit Button on Click - C#

protected override void OnInit(EventArgs e)
{
    btnSearch.Attributes.Add("onclick", "javascript:" + btnSearch.ClientID + ".disabled=true;" 
			+ this.Page.GetPostBackEventReference(btnSearch));
    base.OnInit(e);
}

or

Disable ASP Button on Submit and capture the PostBack OnClick Event


Categories: ASP.NET | C#
Posted by Admin on Sunday, March 15, 2009 3:21 AM
Permalink | Comments (0) | Post RSSRSS comment feed

ASP.NET Error Handling Resources - C#

  1. ASP.NET Custom Error Pages
  2. Error Handling in ASP.Net Ajax Applications
  3. Handling exceptions in ASP.NET Ajax
  4. Asp.net Ajax Exception Logging
  5. How to improve ASP.NET AJAX error handling
  6. Asynchronous error handling change in ASP.NET AJAX 3.5
  7. ScriptManager - AsyncPostBackErrorMessage Property
  8. Tip/Trick: Handling Errors with the UpdatePanel control using ASP.NET AJAX
  9. Error Handling in ASP.NET
  10. Sys.WebForms.PageRequestManagerParserErrorException - what it is and how to avoid it
  11. Configuring Visual Studio to Debug .NET Framework Source Code
  12. ELMAH: Error Logging Modules and Handlers for ASP.NET (and MVC too!)

Tags:
Categories: Ajax | ASP.NET | C#
Posted by developer on Friday, March 13, 2009 4:43 AM
Permalink | Comments (0) | Post RSSRSS comment feed

KOBE – Web 2.0 Service Development Resource Kit

http://www.microsoft.com/downloads/details.aspx?FamilyID=71E85DD2-63F4-47A5-9592-625094EB2852&displaylang=en

Categories: ASP.NET
Posted by developer on Friday, March 13, 2009 3:15 AM
Permalink | Comments (0) | Post RSSRSS comment feed

Loop through an ASP.NET Page controls using the T way

public static T FindControl<T>(this Control control, string controlId) where T : Control
{
    return (T)control.FindControl(controlId);
}

 


Categories: ASP.NET | C#
Posted by Admin on Wednesday, March 11, 2009 7:56 AM
Permalink | Comments (0) | Post RSSRSS comment feed

Reference a ConnectionString in Web.Config from another file

1) Insert your ConnectionString in a text file called Connection.config or any other name.

2) In your Web.Config file, reference the Connection.config file as below:

    <connectionStrings configSource="Connection.config" />.

 

That's it. 


Categories: ASP.NET
Posted by developer on Tuesday, March 10, 2009 3:51 PM
Permalink | Comments (0) | Post RSSRSS comment feed

C# String Split

1)    char[] delimiterChars = { ':'};
       string[] args = t.Split(delimiterChars);

2)    string[] args = t.Split(new char[] {':'});


Categories: C#
Posted by developer on Tuesday, March 10, 2009 3:20 PM
Permalink | Comments (0) | Post RSSRSS comment feed

How to set height of panel in ASP.net 2.0 using coding

panel.attributes.add("style","overflow: auto; width: 100%; height: 100%");

Categories: ASP.NET
Posted by developer on Tuesday, March 10, 2009 3:12 PM
Permalink | Comments (0) | Post RSSRSS comment feed