0% found this document useful (0 votes)
25 views16 pages

Parth Nay An

This document provides instructions for creating an ASP.NET website for a college management system. It includes details on creating registration, login, and master pages for students, faculty, and guests. It also describes uploading photos, listing subjects, and showing data based on user roles. The website allows students to register, login, view subjects, and upload photos using ASP.NET controls and sessions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views16 pages

Parth Nay An

This document provides instructions for creating an ASP.NET website for a college management system. It includes details on creating registration, login, and master pages for students, faculty, and guests. It also describes uploading photos, listing subjects, and showing data based on user roles. The website allows students to register, login, view subjects, and upload photos using ASP.NET controls and sessions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

ASP.

NET

Subject : Asp.Net

Name : Parth kalksariya

Class : TYBCA Div : 1

Roll No : 168 Exam No :

index

Sr. Topic Date Page Sign


No No
1 Create database dbstudent.db as per create student table
,feedback table ,faculty table .
• Create a ASP.NET website for college
management system that allows students
registration ,Login.
• Use adrotator control advertisement
• Use calendar control
• Use menu control
• Use tree control with sitemappath control
• Use Asp.net basic Control like textbox, label,
button, dropdown ,check box ect.
• Use session with login and logout function
• Create master page for guest master that is only
give the feedback
• Create feedback page depend to guest master
• Create registration page and next redirect to
login page for student depend student master
• Student upload the photo
• Show the subject list out
• Again exiting user login same manner
• Create faculty master page
• Faculty show age wise student that is use
validation
• Create admin master page
• Admin show data depend category
• Use more functionality

1
ASP.NET

2
ASP.NET

Subject : Asp.Net

Name : Nayan Gujjar

Class : TYBCA Div : 1

Roll No : 174 Exam No :

index
Sr. Topic Date Page Sign
No No
1 Create database dbstudent.db as per create student table
,feedback table ,faculty table .
• Create a ASP.NET website for college
management system that allows students
registration ,Login.
• Use adrotator control advertisement
• Use calendar control
• Use menu control
• Use tree control with sitemappath control
• Use Asp.net basic Control like textbox, label,
button, dropdown ,check box ect.
• Use session with login and logout function
• Create master page for guest master that is only
give the feedback
• Create feedback page depend to guest master
• Create registration page and next redirect to
login page for student depend student master
• Student upload the photo
• Show the subject list out
• Again exiting user login same manner
• Create faculty master page
• Faculty show age wise student that is use
validation
• Create admin master page
• Admin show data depend category
• Use more functionality

3
ASP.NET

4
ASP.NET

About.us page

REGISTRATION FORM
Imports System.Data.SqlClient Imports
System.Data
Partial Class registration
Inherits System.Web.UI.Page
Dim con As New SqlConnection("Data
Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\N\Desktop\studentinfo\App_Da
ta\dbstud.mdf;Integrated Security=True;User Instance=True")
Protected Sub CustomValidator1_ServerValidate(source As Object, args
As System.Web.UI.WebControls.ServerValidateEventArgs) Handles
CustomValidator1.ServerValidate
Dim len As Integer = args.Value.Length
If len = 10 Then args.IsValid =
True Else args.IsValid
= False
End If
End Sub
Protected Sub btnreset_Click(sender As Object, e As System.EventArgs)
Handles btnreset.Click txtuname.Text = "" txtpwd.Text = ""
End Sub
Protected Sub btnsubmit_Click(sender As Object, e As System.EventArgs)
Handles btnsubmit.Click
Try
If Page.IsValid Then
Dim cmd As New SqlCommand("insert into tblusers
values(@nm,@add,@dob,@gen,@hob,@age,@uname,@pwd,@cpwd,@email,@ut,@mno)",
con)

5
ASP.NET
cmd.Parameters.Add("@nm", SqlDbType.VarChar).Value =
txtname.Text
cmd.Parameters.Add("@add", SqlDbType.VarChar).Value =
txtaddress.Text
cmd.Parameters.Add("@dob", SqlDbType.Date).Value =
CDate(txtbdate.Text)
Dim gen As String = ""
If rbmale.Checked Then gen
= rbmale.Text ElseIf rbfemale.Checked
Then
gen = rbfemale.Text
End If
Dim h As String = "" If chkdance.Checked
Then
h = chkdance.Text
End If
If chkplay.Checked Then h
= h + "," + chkplay.Text
End If
If chkread.Checked Then h = h + "," +
chkread.Text End If
cmd.Parameters.Add("@gen", SqlDbType.VarChar, 50).Value =
gen
cmd.Parameters.Add("@hob", SqlDbType.VarChar, 50).Value = h
cmd.Parameters.Add("@age", SqlDbType.Int).Value = CInt(txtage.Text)
cmd.Parameters.Add("@uname", SqlDbType.VarChar).Value = txtuname.Text
cmd.Parameters.Add("@pwd", SqlDbType.VarChar).Value =
txtpwd.Text
cmd.Parameters.Add("@cpwd", SqlDbType.VarChar).Value =
txtcpwd.Text
cmd.Parameters.Add("@email", SqlDbType.VarChar).Value =
txtemail.Text cmd.Parameters.Add("@ut",
SqlDbType.VarChar).Value = duser.SelectedValue
cmd.Parameters.Add("@mno", SqlDbType.Decimal).Value =
CDec(txtmob.Text) con.Open()
cmd.ExecuteNonQuery() con.Close()
MsgBox("Registration Successful", MsgBoxStyle.OkOnly,
"Result")
Response.Redirect("login.aspx")
End If
Catch ex As Exception
MsgBox(ex.Message)
Finally
If con.State = ConnectionState.Open Then
con.Close()
End If
End Try
End Sub
Protected Sub Calendar2_SelectionChanged(sender As Object, e As
System.EventArgs) Handles Calendar2.SelectionChanged txtbdate.Text
= Calendar2.SelectedDate.ToString

6
ASP.NET
End Sub
End Class

LOGIN FORM
Imports System.Data.SqlClient Imports
System.Data
Partial Class login
Inherits System.Web.UI.Page
Dim con As New SqlConnection("Data
Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\N\Desktop\studentinfo\App_Da
ta\dbstud.mdf;Integrated Security=True;User Instance=True")
Protected Sub btnlogin_Click(sender As Object, e As System.EventArgs)
Handles btnlogin.Click
Dim cmd As New SqlCommand("select count(*) from tblusers where
username=@unm and password=@pwd and usertype=@utype", con)

7
ASP.NET
cmd.Parameters.Add("@unm", SqlDbType.VarChar, 50).Value = txtuname.Text
cmd.Parameters.Add("@pwd", SqlDbType.VarChar, 50).Value = txtpwd.Text
cmd.Parameters.Add("@utype", SqlDbType.VarChar, 50).Value =
lstutype.SelectedValue con.Open() Dim cnt As Integer
cnt = cmd.ExecuteScalar con.Close() If cnt = 1 Then
Session("username") = txtuname.Text
If lstutype.SelectedValue = "Student" Then
Response.Redirect("studenthome.aspx")
ElseIf lstutype.SelectedValue = "Faculty" Then
Response.Redirect("facultyhome.aspx")
ElseIf lstutype.SelectedValue = "Admin" Then
Response.Redirect("adminhome.aspx")
Else
MsgBox("Use Does not exists!!!")
txtuname.Text = "" txtpwd.Text =
"" lstutype.SelectedIndex =
-1
End If
End If
End Sub
End Class

8
ASP.NET

LIST OF SUBJECT

LIST OF SUBJECT
Partial Class subject
Inherits System.Web.UI.Page
Protected Sub btnsub_Click(sender As Object, e As System.EventArgs)
Handles btnsub.Click
Dim sub1 As String = ""
For Each lstitm As ListItem In cblsub.Items
If lstitm.Selected = True Then sub1
= sub1 + " " + lstitm.Text
End If Next sub1 = sub1 + "</br>"
+ rblsub.SelectedItem.Text
Literal1.Text = sub1
End Sub
End Class

9
ASP.NET

UPLOAD PHOTO
Imports System.Data.SqlClient Imports
System.Data
Partial Class uploadphoto
Inherits System.Web.UI.Page
Dim con As New SqlConnection("Data
Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\N\Desktop\studentinfo\App_Da
ta\dbstud.mdf;Integrated Security=True;User Instance=True")
Protected Sub btnsub_Click(sender As Object, e As System.EventArgs)
Handles btnsub.Click
Dim spath As String = Request.PhysicalApplicationPath +
"\studentImages\"
If FileUpload1.HasFile Then
spath = spath + Server.HtmlEncode(FileUpload1.FileName)
FileUpload1.SaveAs(spath)
Dim cmd As New SqlCommand("insert into tbphotos
values(@unm,@img)", con)
cmd.Parameters.Add("@unm", SqlDbType.VarChar).Value =
Session("username") cmd.Parameters.Add("@img",
SqlDbType.VarChar).Value =
"~\studentImages\" + FileUpload1.FileName con.Open()
cmd.ExecuteNonQuery() con.Close()
Response.Write("file uploaded successfully")
Dim cmd1 As New SqlCommand("select photo from tbphotos where
username=@unm", con)
cmd1.Parameters.Add("@unm", SqlDbType.VarChar).Value =
Session("username") con.Open() Dim ipath As
String = "" ipath = cmd1.ExecuteScalar
con.Close()
imgpic.ImageUrl = ipath
Else
Response.Write("file not uploaded successfully")
End If
End Sub
End Class

10
ASP.NET

FACULTY LOGIN
Partial Class facultyhome
Inherits System.Web.UI.Page

Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load


lbluname.Text = Session("username")
End Sub
End Class

11
ASP.NET

12
ASP.NET

VIEW STUDENT DETAILS


Imports System.Data.SqlClient Imports
System.Data
Partial Class viewstudent
Inherits System.Web.UI.Page
Dim con As New SqlConnection("Data
Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\N\Desktop\studentinfo\App_Da
ta\dbstud.mdf;Integrated Security=True;User Instance=True") Protected
Sub Page_Load(sender As Object, e As System.EventArgs)
Handles Me.Load
Dim cmd As New SqlCommand("select name,DOB,gender,hobbies,username
from tblusers where usertype='Student' ", con)
Dim da As New SqlDataAdapter(cmd)
Dim ds As New DataSet da.Fill(ds,
"stud") gvstudent.DataSource =
ds.Tables("stud") Me.DataBind()
End Sub
End Class

13
ASP.NET

GET STUDENT DETAILS


Imports System.Data.SqlClient Imports
System.Data
Partial Class getstudentdetails
Inherits System.Web.UI.Page
Dim con As New SqlConnection("Data
Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\N\Desktop\studentinfo\App_Da
ta\dbstud.mdf;Integrated Security=True;User Instance=True")
Protected Sub btnget_Click(sender As Object, e As System.EventArgs)
Handles btnget.Click
Dim cmd As New SqlCommand("select name,DOB,gender,email,mobileno
from tblusers where age>@age and usertype='Student'", con)
cmd.Parameters.Add("@age", SqlDbType.Int).Value = CInt(txtage.Text)
Dim da As New SqlDataAdapter(cmd)
Dim ds As New DataSet da.Fill(ds,
"stud") gvdetails.DataSource =
ds.Tables("stud") Me.DataBind()
End Sub
End Class

ADMIN LOGIN

Partial Class loginmaster


Inherits System.Web.UI.MasterPage

Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load


lbluname.Text = Session("username")
End Sub
End Class

14
ASP.NET

FEEDBACK FORM
Imports System.Data.SqlClient
Imports System.Data
Partial Class feedback
Inherits System.Web.UI.Page
Dim con As New SqlConnection("Data
Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\N\Desktop\studentinfo\App_Da
ta\dbstud.mdf;Integrated Security=True;User Instance=True") Protected
Sub btnfeedback_Click(sender As Object, e As System.EventArgs) Handles
btnfeedback.Click
Try
Dim cmd As New SqlCommand("insert into tblfeedback
values(@e,@f)", con)
cmd.Parameters.Add("@e", SqlDbType.VarChar, 50).Value =
txtemail.Text
cmd.Parameters.Add("@f", SqlDbType.VarChar).Value =
txtfeedback.Text con.Open() cmd.ExecuteNonQuery()
con.Close()

15
ASP.NET
MsgBox("Feedback Insertes", MsgBoxStyle.OkOnly, "Feedback")
txtemail.Text = "" txtfeedback.Text = "" Catch ex As
Exception
MsgBox(ex.Message)
Finally
If con.State = ConnectionState.Open Then
con.Close()
End If
End Try
End Sub
Protected Sub btndisplay_Click(sender As Object, e As
System.EventArgs) Handles btndisplay.Click
Dim cmd As New SqlCommand("select * from tblfeedback", con)
Dim da As New SqlDataAdapter(cmd)
Dim ds As New DataSet da.Fill(ds,
"tblf") gdvfeedback.DataSource =
ds.Tables("tblf")
Me.DataBind()
'gdvfeedback.DataBind()
End Sub
End Class

16

You might also like