Tuesday, January 20, 2009

Compare DateTime in ASP.NET difference between Datetime

DateTime Dtnow;
Dtnow = DateTime.Now;

DateTime DtAgo;
DtAgo= DateTime.Now.AddDays();

TimeSpan tsDiff = Dtnow.Subtract(DtAgo);

string Diff = tsDiff.ToString() or tsDiff.Minutes.ToString();

squirrelmail Free Email Server


SquirrelMail is a web-based email application started by Nathan and Luke Ehresman and written in the PHP scripting language. It can be installed on almost all web servers as long as PHP is present and the web server has access to an IMAP and SMTP server.

http://www.squirrelmail.org

TemplateField & BoundField & Command Field in Gridview C# ASP.NET

  1.  <asp:BoundField DataField="ID" HeaderText="ID" >

  2.   </asp:BoundField>

  3. <asp:TemplateField HeaderText="ID" SortExpression="ID" >

  4.     <EditItemTemplate>

  5.         <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("ID") %>'></asp:TextBox>

  6.     </EditItemTemplate>

  7.     <ItemTemplate>

  8.         <asp:Label ID="Label1" runat="server" Text='<%# Bind("ID") %>'></asp:Label>

  9.     </ItemTemplate>

  10. </asp:TemplateField>

  11. <asp:TemplateField>

  12.     <ItemTemplate>

  13.         <asp:ImageButton ID="imgbutton" runat="server" CausesValidation="false" CommandName="Delete" ImageUrl="images.png" Text=""  CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" ToolTip="delete file" />

  14.     </ItemTemplate>

  15. </asp:TemplateField>

  16. # in Code Behind

  17.  protected void Grid_RowCommand(object sender, GridViewCommandEventArgs e)

  18. {

  19.         if (e.CommandName == "Delete")

  20.         {

  21.             int rowIndex = Convert.ToInt32(e.CommandArgument);

  22.             GridViewRow row = (sender as GridView).Rows[rowIndex];

  23.             int Id = (int)Grid.DataKeys[row.RowIndex].Value;

  24.         }

  25. }

  26. protected void Grid_RowDataBound(object sender, GridViewRowEventArgs e)

  27.     {

  28.         if (e.Row.RowType == DataControlRowType.DataRow)

  29.         {

  30.             DataRowView rowView = (DataRowView)e.Row.DataItem;

  31.             ImageButton imgButton = (ImageButton)e.Row.Cells[1].Controls[1];

  32.         }

  33.     }

  34.              

Saturday, January 17, 2009

Flash Demo UML

this is 16 MB falsh demo of How to Model Rational RequisitePro use case requirements for Rational Software Architect.

to download go to IBM and login with your account:

http://www.ibm.com/developerworks/offers/lp/demos/summary/modelreq.html?S_TACT=105AGY17&S_CMP=TRLPORT

Thursday, January 15, 2009

How to write HTML source code in your Blog

with http://quickhighlighter.com/ you can make HTML code visible in your webpages

  1. <script type="text/javascript" language="javascript">
  2. document.getElementById('<%= txtUsername.ClientID %>').focus();
  3. </script>


if you want to have source code go to http://code.google.com/p/syntaxhighlighter/

Tuesday, January 13, 2009

Set Focus on login textbox on the page load asp.net

document.getElementById('<%= txtUsername.ClientID %>').focus();

Install TOM TOM Navigator 6 on Pocket PC

I have a windows mobile phone and on the CD that I have there is a TOM TOM navigator application for PC that allows me to add maps and voice to application on my phone.

but the problem was that I uninstalled the application on my phone and I wasnt able to find the sofware to install on my phone.

so if you want to install TOM TOM navigator on you phone go to

http://uk.support.tomtom.com/cgi-bin/tomtom_uk.cfg/php/enduser/std_adp.php?p_faqid=6736&Lid=1

all the steps are inside the page

Sunday, January 11, 2009

Formalism

I was reading an article about UML 2 and I saw this picture and I thought maybe its also funny for you

My Add-ones plugin in Firefox 3

1. Better GMail
Enhance the Gmail Capabilities

2. DrogDropUpload
Drop your files to Gmail for attachment

3.Video Downloadhelper
easy way to download the videos

4.DownThemAll
Download Manager in FireFox

5.Firebug
You can edit, debug, and monitor CSS, HTML, and JavaScript live in any web page...

6.Web developer
Adds a menu and a toolbar with various web developer tools.

7.Stylish
Allows you to add style to FF and then you can add multiple style like

Bright Focus for Textboxes Only (modified) from here : http://userstyles.org/styles/10652

8.IranianCalender
Display today date in Iranian calendar in the status bar.

9.ColorZilla
ColorPicker

10. Autofill forms

11.ColorZilla

Thursday, January 8, 2009

Disable button to prevent multiple click C#.net

just add following code in Page_load

Button1.Attributes.Item("onclick") = "this.disabled=true;" & GetPostBackEventReference(Button1).ToString