Friday, August 26, 2011

Caleder Control Of Ajax


asp:TextBox and ajaxToolkit:CalendarExtender, so the page should be look like:
<html xmlns="http://www.w3.org/1999/xhtml">
  <head runat="server">
    <title>Untitled Page</title>
  </head>
  <body>
    <form id="form1" runat="server">
      <ajaxToolkit:ToolkitScriptManager ID="ScriptManager1"runat="server" />
      <div>
        <asp:TextBox ID="Date1" runat="server"></asp:TextBox>
        <ajaxToolkit:CalendarExtender
            ID="CalendarExtender1" runat="server"TargetControlID="Date1">
        </ajaxToolkit:CalendarExtender>
      </div>
    </form>
  </body>
</html>
Note that TergetControlID point to the text box id.


Thursday, August 4, 2011

ASP.NET login page with sql server


First we have to create a database for storing the login information

Open the Sqlserver Management studio

Create a new database and change the database name as db_Logininformation
Create a New table in that database(db_Logininformation) and change the table name as tab_userinformation

Now, create the following fields
1.  UserID   int         PrimaryKey  
2.    
3.  username varchar(50)  
4.    
5.  Password varchar(50)  

Next, Enter the some usernames and paasword directlu in the database for checking purpose

and save the table

Next ,open the Microsoft visual studio 2008

Next,select the Aspnet web application and change the name as LoginPage

Next,come to the design page of LoginPage and drag and drop two labels,two textboxes and button

next,come to the code page of the Login.aspx.cs

Write the following codein the page event

1.  protected void Button1_Click(object sender, EventArgs e)  
2.      {        
3.          con = new SqlConnection(ConfigurationManager.ConnectionStrings["connectionstring"].ToString());  
4.          con.Open();  
5.          com = new SqlCommand("select Password from userinformation where Username='" + txt_uname.Text + "'", con);  
6.          dr = com.ExecuteReader();  
7.          if (!dr.Read())  
8.          {  
9.              Response.write("Invalid User");  
10.         }  
11.         else  
12.         {  
13.             if (dr[0].ToString() == txt_pwd.Text)  
14.             {  
15.                 Response.Redirect("~/mainPage.aspx");  
16.             }  
17.             else  
18.             {  
19.                Response.write("Wrong Password");  
20.                txt_pwd.Focus();  
21.             }  
22.         }  
23.   
24.     }  
finally,Execute the page....Thats it...Happy coding

AngularJS Basics - Part 1

                                                                  AngularJS What is AngularJS ·          Framework by googl...