Click on this icon to open the XML page.Tom Van Gaever - Blog
Search:   

Confirmation box before a delete - ASP.NET - C# 
Tuesday, November 13, 2007, 07:04
Posted by Administrator
When you want to delete an entry, when the user presses a button it would be useful to display a confirmation bo where the user can reconsider if he wants to delete the object...

When developing in asp.net you can't use the Messagebox.Show() method :p but you can use this alternative:


btn_Delete.Attributes.Add("onclick", "if(confirm('Are you sure to delete?')){}else{return false}");


the asp.net code for the button:


<asp:Button id="btn_Delete" runat="server" Text="delete" CssClass="button" onclick="btn_Delete_Click" />


When the popup messagebox is displayed and the user chooses "ok" the function btn_Delete_Click() will be executed otherwise the postback will be ignored.
add comment ( 6 views )   |  permalink   |   ( 3 / 480 )
Culture Info SQL 2005 
Tuesday, November 6, 2007, 11:25
Posted by Administrator
ALways handy to optimize your code so that the Datetime formats are the same as in your sql server...


public CultureInfo GetCultureInfo(Server server) {
CultureInfo ci
SqlConnection conn = new SqlConnection(server.ConnectionContext.ConnectionString);
SqlCommand cmd = conn.CreateCommand();
cmd.CommandText = "select lcid from sys.syslanguages where langid=@@langid";
cmd.CommandType = CommandType.Text;
using (conn) {
conn.Open();
int lcid = (int)(cmd.ExecuteScalar());
ci = new CultureInfo(lcid);
}
conn.Close();
return ci;
}

add comment ( 16205 views )   |  permalink   |  related link   |   ( 2.9 / 171 )
Visual C# Default Keybindings Cheat Sheet 
Wednesday, September 26, 2007, 08:40
Posted by Administrator
If you can’t tell, I love cheat sheets. I’ve come across another excellent one.

This one is produced by Microsoft and contains the default keybindings for Visual C#.

You can view the PDF here .


add comment ( 4 views )   |  permalink   |  related link   |   ( 3 / 448 )
LinkedIn.com 
Sunday, September 16, 2007, 10:03
Posted by Administrator
View Tom Van Gaever's profile on LinkedIn
add comment ( 4 views )   |  permalink   |   ( 3 / 409 )
Lifted, Pixar’s latest short film 
Sunday, September 16, 2007, 09:44
Posted by Administrator



Lifted is Pixar’s latest short film that was released theatrically with the movie Ratatouille.
add comment ( 4 views )   |  permalink   |   ( 3 / 545 )

<<First <Back | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | Next> Last>>