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.

Sunday 25 November 2012

AngularJS tutorial for beginners or Introduction to Angular JS

What is AngularJS:
AngularJS is an open-source JavaScript framework, maintained by Google, that assists with running single-page applications. Its goal is to augment browser-based applications with model–view–controller (MVC) capability, in an effort to make both development and testing easier.

Angular JS Email Validation in ASP.NET


<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css" >
    .error
    {
        color:Red;
    }

Tuesday 9 October 2012

Aspdotnet-Roja----Site Map-Home

                         Hi Friends ,in this article i will provide all the topics in my blog,i think it will helpful to you to search particular article of what you want.Happy Searching and happy reading my Blog......Thank U All...........................................

Sunday 7 October 2012

.ready() function in JQuery | $(document).ready() | jQuery Event ready() Method

                                  Hi friends , in this article I will explain about  .ready()  method in JQuery with example.
                                 I already explained in the previous article What is JQUERY | JQuery Tutorial | JQuery syntaxes. See once if you want to know.
JQuery:
  • jQuery is a JavaScript Library.
  • It simplifies the JavaScript programming.
  • jQuery is a lightweight "write less, do more" JavaScript library.
  • It is a library of JavaScript functions.

Wednesday 3 October 2012

Contact Us.

If you want to contact me or want to give advise or request of the article or comment then please comment in the comment Box.

Thanks & Regards,
Sairoja Kishore

Wednesday 26 September 2012

Data Access namespaces in .NET? | What are data access namespaces in .NET?

                                 Hi Friends, in this article I will explain about what are the data access namespaces in .NET?
                                 I already explained in the previous article what is ADO.NET? and What are the two fundamental objects in ADO.NET?,.NET Framework Data Providers | What are .NET Framework Data Providers see once if you need.
                                 The core ADO.Net classes exist in the System.Data namespace in the .Net Framework class library.

Monday 24 September 2012

How to export gridview data to CSV file or Export Gridview data to CSV file using C# or VB.NET | Export Dataset/Datatable to Excel or CSV?

                                Hi Friends, in this article I will explain about How to export GridView data to CSV file or Export Gridview data to CSV file using C# or VB.NET | Export Dataset/Datatable to Excel or CSV?
                               In this article I will explain about how to take the data from database and Display in GridView and save as Excel file.
I will explain using the below example.
                               Take GridView and button and set the GridView id as StudentGridView and button as Button1.

Friday 21 September 2012

.NET Framework Data Providers | What are .NET Framework Data Providers

                    Hi Friends, in this article I will explain about .NET Framework Data Providers ?
In previous article I already explained about What is ADO.NET? and What are the two fundamental objects in ADO.NET?  see once if you need.
.NET Framework Data Providers:
  • Data Provider is nothing but a set of libraries that is used to communicate with data source.
  • The libraries specifically written for .NET applications to connect and work with data sources are known as .NET Framework Data Provider.

Sunday 16 September 2012

What is ADO.NET? and What are the two fundamental objects in ADO.NET?

                                Hi Friends, in this article I will explain about what is ADO.NET? And what are the two fundamental objects in ADO.NET?

What is ADO.NET?
  •  The full form of ADO is ActiveX Data Object.
  • ADO.NET is very important feature of the .NET Framework.

Monday 10 September 2012

Differences between Stored Procedures and Functions | Stored Procedures vs Functions (Difference between SP & UDF)

                                Hi Friends, in this article I will explain about what is the differences between stored procedures and functions in SQL Server. In many interviews this question is compulsory.
                             I already explained in the previous article Difference between TRUNCATE, DELETE and DROP commands in SQL SERVER.

Difference between stored procedures and functions:
  • Stored Procedure can return zero or n values whereas function can return 1 value.Function must return a value which is mandatory but in stored procedure it is optional. Procedure can   return multiple values (max 1024).

Friday 7 September 2012

Difference between TRUNCATE, DELETE and DROP commands in SQL SERVER

                                     Hi Friends, in this article I will explain about the Difference between TRUNCATE, DELETE and DROP commands in SQL SERVER.For many interviews this question is frequently asked.
First of all we know those individually after that we will know differences.

Truncate:
TRUNCATE Command  removes all the data or all rows from a table.
·         We cannot use where clause with Truncate command.
·         The operation cannot be rolled back and no triggers will be fired because it does not log individual rows.
·          As such, TRUCATE is faster and doesn't use as much undo space as a DELETE.
·         It frees the space containing the table.
·         Identity columns are re-seeded on this operation, if no seed was defined then the default value 1 is used.
·         This is a DDL command as its resets identity columns, deallocates data pages and empties them for use of other objects in the database.

Wednesday 29 August 2012

How to add dynamic controls in VB.NET or C# windows forms | How to add textbox at runtime | How to dynamically add control with loop at Runtime

                       Hi Friends, in this article I will explain about How to add dynamic controls in VB.NET or C# windows forms or  How to add textbox at runtime or How to dynamically add control with loop at Run time.
                       Suppose if we want to add textboxes in the loop then we use this process. Suppose if we to display some number of textboxes then we can’t take the textboxes before run the code. For that time we can display textboxes at runtime. Not only textboxes we can any controls like labels, buttons, checkboxes etc.

Thursday 23 August 2012

Shortcut Keys for Visual Studio || Visual Studio ShortCut KEYS

                            Hi friends, in this article I will give some important shortcuts to Visual Studio.      
In previous articles i explained about how to readthe data from excel in VB.NET or C# windows Forms.,the TreeView Control,SiteMapDataSource Control in ASP.NET ,how to send email using Gmail in VB.NET or C#.                    
                            I think it will useful to all .NET Developers and learners. Because Shortcut keys decreases the time when we writing the code. I searched in so many sites and get some Shortcut keys and place them in below tables. I think it may useful to you. Happy reading my blog and Thanks for reading my Blog.  If you want to give any advices then give advice as comment in the comment box.

Tuesday 21 August 2012

Read data from Excel in VB.NET or C# windows forms | Export data from Excel to Text file

                                    Hi friends, in this article I will explain about how to read the data from excel in VB.NET or C# windows Forms.
                                   I searched so many sites and finally get the solution of how to read the data from excel in VB.NET or C# windows Forms.You can know the How to add dynamic controls in VB.NET or C# windows forms | How to add textbox at runtime | How to dynamically add control with loop at Runtime in the next article How to add dynamic controls in VB.NET or C# windows forms | How to add textbox at runtime | How to dynamically add control with loop at Runtime
For this first we have to add the reference Microsoft.Office.Interop.Excel.
Menu—project—Add reference—COM—Microsoft Excel 12.0 Object Library
Next come to code and imports or using Microsoft.Office.Interop.Excel

Monday 30 July 2012

ASP.NET TreeView Control | TreeView Control,SiteMapDataSource Control in ASP.NET | TreeView Control Example in ASP.NET

                         Hi Friends, I already explained some topics in the ASP.NET ,in this article I will explain about the TreeView Control,SiteMapDataSource Control  in ASP.NET
  • TreeView Control is introduced in ASP.NET 2.0.
  • TreeView is used to display hierarchical data.

Thursday 26 July 2012

How to send mail through asp.net using c# or VB.NET | Sending Mail in ASP.NET using C# or VB.NET

                                  Hi friends, in this article I will explain about how to send email using Gmail in VB.NET or C#.
                                 Sending email's from web applications is a very common requirement in most projects. This article explores how to send Emails in ASP.NET.In ASP.NET, sending emails has become simpler. The classes required to send an email are contained in the System.Net.Mail.

ValidationSummary in ASP.NET | How to use ValidationSummary in ASP.NET | What is the use of ValidationSummary in ASP.NET

Hi friends, in this article I will explain about How to use ValidationSummary control in ASP.NET, Custom Validation Summary in ASP.NET.
The ValidationSummary control is used to display a summary of all validation errors occurred in a Web page.
The error message displayed in this control is specified by the ErrorMessage property of each validation control. If the ErrorMessage property of the validation control is not set, no error message is displayed for that validation control.

CustomValidator Control in ASP.NET | What is the use of CustomValidator Control in ASP.NET | How to use the CustomValidator Control in ASP.NET

Hi friends, in this article I will explain about CustomValidator Control, How to Validate with a Custom Function for ASP.NET Server Controls, ASP.NET CustomValidator Control.
CustomValidator   is used to writing application specific custom validation routines. We can use ASP.NET CustomValidator control to validate either client side or at server side.
I will explain CustomValidator   example in 2 ways

What is RegularExpressionValidator Control in ASP.NET | What is the use of RegularExpressionValidator Control in ASP.NET | How to use RegularExpressionValidator Control in ASP.NET

                                     Hi friends, in this article I will explain about RegularExpressionValidator for Email ID in ASP.NET or  ASP.NET RegularExpressionValidator example.
The RegularExpressionValidator control is used to check that an input value matches a specified pattern or not.
I will explain this with small example.
Take one new web site(file--- new website--- give name o the website).
Take one webpage name it as resularexp.aspx and drag and drop the RegularExpressionValidator as shown in the below figure.



And write the following code in the .aspx source file.
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="regularexp.aspx.vb" Inherits="regularexp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>RegularExpressionValidator for Email ID</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <h1 style="color:Green ">RegularExpressionValidator for Email ID</h1>
    Enter Email Adress:<asp:TextBox ID="Email" runat="server" Width="240px"></asp:TextBox>
    <asp:RegularExpressionValidator
                ID="RegularExpressionValidator1"
                runat="server"
                ErrorMessage="Email missed @ or ','.Pls Check once and Enter Valid Email ID"
                ValidationGroup="rgSubmit"
                ControlToValidate="Email"
                CssClass="requiredFieldValidateStyle"
                ForeColor="Red"
                ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">
    </asp:RegularExpressionValidator>
    </div>
    </form>
</body>
</html>

In the above web page.I put the code for cheching the email address.It checks only @ and ‘,’ is there or not.If  either @ or ‘,’ miss it will raise the error Email missed @ or ','.Pls Check once and Enter Valid Email ID .Run the code. It will like below .if you don’t enter valid email address it will shown like below figure.


in previous articles i explained about validation controls in ASP.NET and how to use the validation controls in ASP.NET.
CompareValidator in ASP.NET
CustomValidator Control, How to Validate with a Custom Function for ASP.NET Server Controls, ASP.NET CustomValidator Control.
RegularExpressionValidator for Email ID in ASP.NET or ASP.NET RegularExpressionValidator example.
ValidationSummary in ASP.NET
 I think you like my blog Aspdotnet-Kishore why are waiting following me on facebook fan page Aspdotnet-Kishore

Monday 23 July 2012

ASP.NET Validation Controls with example | How to use ControlValidator in ASP.NET | ControlValidator Control in ASP.NET

                                   Hi Friends, in this article i will explain about the CompareValidator in the ASP.NET. CompareValidator is used to compare the value of one input control with value of another input control or a fixed value.
                                   I already explained in the previous article ASP.NET Validation Controls with example | How to use Validation Controls in ASP.NET | RequiredFieldValidation Control in ASP.NET

Saturday 21 July 2012

ASP.NET Validation Controls with example | How to use Validation Controls in ASP.NET | RequiredFieldValidation Control in ASP.NET

                                     Hi Friends, in this article I will explain about the validation controls in ASP.NET and how to use the validation controls in ASP.NET.
                                     Validation server controls are used to validate user-input. Validation controls are used to validate the input data, because if we didn't put the validation to user input then it will display the error to the user.
In previous articles i explained some interview Questions on ASP.NET,VB.NET and SQL Server.

Tuesday 10 July 2012

ASP.NET 2.0 Page Event Life Cycle


                             Hi Friends, in this article i will explain about ASP.NET 2.0 Page Life Cycle.
Main Events :
1. OnPreInit
2. OnInit
3. OnInitComplete
4. LoadViewState
5. OnPreLoad

Friday 6 July 2012

Windows Authentication to Access SQL Server Through a ASP.NET Web Application || Configuring SQL Server || Configuring IIS: || Configuring the ASP.NET Web Application || Creating Connection Strings

We need to configure the following four different areas to access Windows integrated security:
1.     SQL Server
2.     IIS Web Server
3.     ASP.Net web application
4.     ConnectionString

Wednesday 4 July 2012

Interview Questions on SQL SERVER Part I | Interview Questions and Answers on SQL SERVER Part I

                  Hi Friends, in this article I will share some interview Questions on SQL SERVER.
I already explained some interview Questions on SQL SERVER in Interview Questions and Answers on SQL SERVER Part II
1.What is Sql server?
                SQL - Structured query language is the standard command set used to communicate with the relational database management system.

Friday 29 June 2012

Interview Questions in VB.NET, .NET Framework. | Interview Questions Part II

                      Hi friends, in this article I am posting some interview Questions VB.NET and .NET Framework. In previous articles i explained interview questions in ASP.NET,VB.NET,Sql Server in Interview Questions.Check it once if you need.


1.What is VB.NET?
 Visual Basic .NET (VB.NET), is an object-oriented computer programming language .
VB.Net is windows based programming language. It supports OOP concepts such as
abstraction, inheritance, polymorphism and aggregation.
_________________________________________________________________

What is JQUERY | JQuery Tutorial | JQuery syntaxes

                                    Hi Friends, in this I will explain about the JQuery.I search in so many sites for the JQuery syntax and write the all the syntax  in the one program for the testing. I think it may useful to you.
JQuery:
jQuery is a JavaScript Library.

Thursday 28 June 2012

ASP.NET interview Questions Part-I | .NET interview Questions for 1-2 years Experience

                   Hi friends, in this article I am posting some interview Questions VB.NET and .NET Framework and i explained the interview questions in the previous articles Interview Questions on ASP.NET,VB.NET and SQL Server and ASP.NET Page Life Cycle Events || What is the sequence in which ASP.NET events are processed? Interview Questions on ASP.NET  All the Best Friend.
1.What is VB.NET?
 Visual Basic .NET (VB.NET), is an object-oriented computer programming language .
VB.Net is windows based programming language. It supports OOP concepts such as
abstraction, inheritance, polymorphism and aggregation.

Wednesday 20 June 2012

How to delete the text file or Notepad file or.txt file in VB.NET or C# windows forms.


                              Hi Friends, in this article I will explain about how to delete the text file or Notepad file or.txt file in VB.NET or C# windows forms.

                              I already explained in the previous article How to Create, Read, Write, Copy, Move and Delete a Text File or notepad file using C# and VB.NET

How to move the text file or Notepad file or.txt file in VB.NET or C# windows forms

Hi Friends, in this article I will explain about how to move the text file or Notepad file or.txt file in VB.NET or C# windows forms.
I already explained in the previous article How to Create, Read, Write, Copy, Move and Delete a Text File or notepad file using C# and VB.NET

                           For moving the text file we have to using or imports the System.IO namespace. Because the all file classes and methods are located in System.IO namespace. We use the System.IO.File.Move() method to move the text file.

Tuesday 19 June 2012

How to copy a text file or notepad file or .txt file in VB.NET or C# windows forms..

Hi friends, in this article I will explain about how to copy a text file or notepad file or .txt file.
I already explained in the previous article How to Create, Read, Write, Copy, Move and Delete a Text File or notepad file using C# and VB.NET

How to write to a Text file or a notepad file or a .txt file or AppendText() method in .NET

Hi friends, in this article I will explained about how to write to a Text file or a notepad file or a  .txt file or AppendText() method in .NET.
                      I already explained in the previous article How to Create a Text File or notepad file using C# and VB.NET, in that i was using CreateText() method. If you want to write the data to a already file then we are using the AppendText() method.

How to read the text file in C#.NET or VB.NET Windows Forms || StearmReader

Hi friends, in the previous article I explained about How to Create Text File or notepad file using C# and VB.NET.In this article I will explain about how to read the text file in C#.NET or VB.NET.
                         For this we are using StreamReader.StreamReader is a class.It reads the text. It found in System.IO namespace.
Let I explain using the examples.

How to Create, Read, Write, Copy, Move and Delete a Text File or notepad file using C# and VB.NET

                                  Hi friends, in this article I will explain about Create, Read, Write, Copy, Move and Delete a Text File or notepad file using C# and VB.NET.
                                 For the Create, Read, Write, Copy, Move and Delete a Text File or notepad file using C# and VB.NET  we have use the namespace System.IO.Because the above file methods included in System.IO namespace.

Tuesday 12 June 2012

How to read the data from NOTEPAD or .txt file.How to split the .txt file and save in different .txt files in windows forms.

                             Hi Friends in this article I will explain about how to read the data from NOTEPAD or .txt file. How to split the .txt file and save in different .txt files in windows forms.

Monday 11 June 2012

How to save the data in notepad in VB.NET or C# windows forms and how to create notepad file or how to append the data to existing notepad file in VB.NET or C# windows forms.

                                        Hi friends, in this article I will explain about how to save the data in notepad in VB.NET or C# windows forms and how to create notepad file or how to append the data to existing notepad file in VB.NET or C# windows forms.
First of all, take one windows form.
File—New—Project or Ctrl+Shift+N
Then take the 2 textboxes , 2 labels and 1 button in the below figure.

Tuesday 8 May 2012

Update Panel in AJAX | AJAX Tutorial | Example for Update Panel | Code for Update Panel in AJAX

                               Hi friends, in this article I will explain about the Update Panel in AJAX.I already explained in the previous article  Ajax Tutorial | Ajax small Example to show date | Ajax in ASP.NET.
Update Panel:
It is the most important control in ASP.NET AJAX Package.
It is allowing partial rendering of the area.
We already used it in the previous article  Ajax with example , and in this article, we will go in depth with more aspects of the control. 
© 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.