html:
<%@ Master Language="VB" CodeFile="userPanelMasterPage.master.vb" Inherits="userPanelMasterPage" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Directorate of School Education Jammu</title>
<script type="text/javascript" language="javascript">
history.forward(1);
</script>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="css/font-awesome.min.css"/>
<asp:ContentPlaceHolder ID="contentPlaceHolderHead" runat="server"></asp:ContentPlaceHolder>
</head>
<body class="bodyfontstyle">
<form id="Form1" runat="server" autocomplete="off">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td height="7" class="bluecolor"></td>
</tr>
<tr>
<td class="banner" align="center"><table width="1200"><tr><td><h1 class="bannertitle">Directorate Of School Education Jammu</h1></td></tr></table></td>
</tr>
<tr>
<td align="center">
<table width="1200">
<tr>
<td align="right"><asp:LinkButton ID="LinkButton1" runat="server" PostBackUrl="~/index.aspx" CssClass="fa fa-sign-out signout"> Sign Out</asp:LinkButton></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center" class="bodypage" valign="top">
<asp:ContentPlaceHolder ID="contentPlaceHolderBody" runat="server"></asp:ContentPlaceHolder>
</td>
</tr>
<tr>
<td class="footerclass" align="center">
<span>Website designed & developed by National Informatics Center.</span>
</td>
</tr>
</table>
</form>
</body>
</html>
vb:
Imports System.Data.SqlClient
Partial Class user_panel
Inherits System.Web.UI.Page
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Request.UrlReferrer = Nothing Then
Response.Redirect("index.aspx", True)
Exit Sub
End If
If Session("sponsor") = Nothing Then
Response.Redirect("index.aspx", True)
Exit Sub
End If
If Session("school") = Nothing Then
Response.Redirect("index.aspx", True)
Exit Sub
End If
If Session("mobile") = Nothing Then
Response.Redirect("index.aspx", True)
Exit Sub
End If
If Not Page.IsPostBack Then
lbloggedin.Text = Session("sponsor") & " <strong>|</strong> " & Session("school") & " <strong>|</strong> " & Session("mobile")
textboxsponsorname.Text = Session("sponsor")
textboxschoolname.Text = Session("school")
textboxcontactno.Text = Session("mobile")
loadclassrecog()
End If
End Sub
Sub loadclassrecog()
Dim i As Integer = 0
dropdownclassrecoganized.Items.Clear()
dropdownclassrecoganized.Items.Add("--Select--")
dropdownclassrecoganized.Items(i).Value = 0
Using con As New SqlConnection(ConfigurationManager.ConnectionStrings("dsejConnectionString").ConnectionString)
Using cmd As New SqlCommand("Select * from class_master", con)
con.Open()
Dim dr As SqlDataReader = cmd.ExecuteReader
While dr.Read
i += 1
dropdownclassrecoganized.Items.Add(dr("classname"))
dropdownclassrecoganized.Items(i).Value = dr("id")
End While
con.Close()
End Using
End Using
End Sub
Protected Sub RadioButtonList1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RadioButtonList1.SelectedIndexChanged
If RadioButtonList1.SelectedIndex = -1 Then
ScriptManager.RegisterStartupScript(Me, Page.GetType, "Script", "msgbox('You Must Select Affiliation Before Proceed');", True)
Exit Sub
ElseIf RadioButtonList1.SelectedIndex <> -1 Then
panelAffliationType.Visible = True
Exit Sub
End If
End Sub
Protected Sub radiobuttonMC_SelectedIndexChanged(sender As Object, e As EventArgs) Handles radiobuttonMC.SelectedIndexChanged
If radiobuttonMC.SelectedIndex = 0 Then
paneluploadmc.Visible = True
Else
paneluploadmc.Visible = False
End If
End Sub
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim estddate As Date = Convert.ToDateTime(textboxestablishment.Text.Trim())
If estddate >= Now.Date Then
ScriptManager.RegisterStartupScript(Me, Page.GetType, "Script", "msgbox('Date of establishment should be less than current date.');", True)
Exit Sub
End If
End Sub
Protected Sub Page_Init(sender As Object, e As EventArgs) Handles Me.Init
If Not Me.Page.EnableViewStateMac Then
Throw New InvalidOperationException("The page does NOT have the MAC enabled and the viewstate is therefore vulnerable to tampering.")
End If
Me.ViewStateUserKey = Me.Session.SessionID
End Sub
End Class
Web.Config:
<pages controlRenderingCompatibilityVersion="4.0" clientIDMode="AutoID" enableViewStateMac="true">