Thursday, July 29, 2010

Checking if a string is numeric in C#

 int sidNumber;
bool isInteger = Int32.TryParse(sid, out sidNumber);

Wednesday, July 28, 2010

Add a JavaScript alert box

http://www.beansoftware.com/ASP.NET-Tutorials/Message-Box.aspx

http://www.dotnetspider.com/forum/ViewForum.aspx?ForumId=32564

Credits to chakravarthy


string tmp = "";
tmp = "";
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "MyScript", tmp);
and if u want to alert message for Exceptions
string tmp = "";
tmp = "";
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "MyScript", tmp);

Adding Client-Side Confirmation When Deleting

http://www.asp.net/data-access/tutorials/adding-client-side-confirmation-when-deleting-cs

Here's some example code

<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="True" 
CommandName="Delete" Text="Delete" OnClientClick="return confirm('Are you sure you wish to delete this record?');" />