Monday 10 December 2012

How to convert a numeric value into English words in ASP.NET using c#/VB.NET.

How to convert a numeric value into English words in ASP.NET using c#/VB.NET.

ASP.NET:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>How to convert a numeric value into English words in ASP.NET using c#/VB.NET</title>
</head>
<body>
    <form id="form1" runat="server">

Sunday 9 December 2012

jQuery empty() and remove() methods by Example in ASP.NET

ASP.NET:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>jQuery empty() and remove() methods by Example</title>
    <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
    <style type="text/css">

Thursday 6 December 2012

Issue in modalpopupextender when clicking enter key in textbox Or Trigger a Button Click with JavaScript on the Enter key in a TextBox

Issue in modalpopupextender when clicking enter key in textbox Or Trigger a Button       Click with JavaScript on the Enter key in a TextBox
<%@ Register Assembly="AjaxControlToolkit"Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Issue in modalpopupextender when clicking enter key in textbox Or Trigger a Button
        Click with JavaScript on the Enter key in a TextBox</title>
    <script language="javascript" type="text/javascript">
        function btnclick() {
            alert("Hi");
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <ajax:ModalPopupExtender ID="ModalRecipients"BehaviorID="ModalRecipients" runat="server"
            PopupControlID="pnlRecipients" DropShadow="true"
            TargetControlID="btnMain"BackgroundCssClass="modalBackground">
        </ajax:ModalPopupExtender>
        <div style="overflow: auto;">
            <asp:Panel ID="pnlRecipients" runat="server" Width="550px"Style="background-color: White;
                display: none">
                <asp:TextBox runat="server" ID="txt" onkeydown="if (event.keyCode == 13) document.getElementById('btn').click()" />
                <asp:Button runat="server" ID="btn" OnClick="btn_Click"Text="button" />
            </asp:Panel>
              <asp:Button runat="server" ID="btnMain"OnClick="btnMain_Click" Text="MainPage Button"  UseSubmitBehavior="false" />
        </div>
    </div>
    </form>
</body>
</html>

C#:
using System.Globalization;


public partial class EnterKeyCheck : System.Web.UI.Page
{
    protected void btn_Click(object sender, EventArgs e)
    {
        Response.Write(txtData.Text );
    }
   
    protected void btnMain_Click(object sender, EventArgs e)
    {
        ModalRecipients.Show();
    }
  
}


VB.NET:
Imports System.Globalization

Partial Public Class EnterKeyCheck
    Inherits System.Web.UI.Page
    Protected Sub btn_Click(ByVal sender As ObjectByVal e As EventArgs)
        Response.Write(txtData.Text )
    End Sub

    Protected Sub btnMain_Click(ByVal sender As ObjectByVal e As EventArgs)
        ModalRecipients.Show()
    End Sub

End Class



Output:




How to convert dd-mm-yyyy into dd/mm/yyyy in ASP.NET using C#/VB.NET

How to convert dd-mm-yyyy into dd/mm/yyyy in ASP.NET using C#/VB.NET

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>How to convert dd-mm-yyyy into dd/mm/yyyy in ASP.NET using C#/VB.NET</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:TextBox ID="txtDate" runat="server"></asp:TextBox><br />
        <asp:Label ID="lblDate" runat="server"></asp:Label><br />
        <asp:Button ID="btnConvert" Text="Convert" runat="server"
            onclick="btnConvert_Click" />
    </div>
    </form>
</body>
</html>

In C#:
using System.Globalization;

public partial class DateConversion : System.Web.UI.Page
{
       #region How to convert dd/mm/yyyy into dd-mm-yyyy

    protected void btnConvert_Click(object sender, EventArgs e)
    {
        DateTime dt = DateTime.ParseExact(txtDate.Text, "dd/MM/yy", CultureInfo.InvariantCulture);
        lblDate.Text = dt.ToString("dd-MM-yyyy");
    }
    #endregion
}


In VB.NET:
Imports System.Globalization

Partial Public Class DateConversion
    Inherits System.Web.UI.Page
#Region "How to convert dd/mm/yyyy into dd-mm-yyyy"

    Protected Sub btnConvert_Click(ByVal sender As Object, ByVal e As EventArgs)
        Dim dt As DateTime = DateTime.ParseExact(txtDate.Text, "dd/MM/yy", CultureInfo.InvariantCulture)
        lblDate.Text = dt.ToString("dd-MM-yyyy")
    End Sub
#End Region
End Class

Output:


Monday 26 November 2012

HTML helpers in ASP.NET MVC 2


HTML helpers in ASP.NET MVC 2

DisplayFor: Returns HTML markup for each property in the object that’s represented
by the expression.
© 2012-2018 Aspdotnet-Kishore.blogspot.com. All Rights Reserved.
The content is copyrighted to Kishore and may not be reproduced on other websites without permission from the owner.