Please help when i open my webpage on first the date input masks but after click on the button of getdetails the input mask stops showing please help
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/FormsV2/Site1.Master" CodeBehind="Biodata.aspx.vb" Inherits="SMIS2022WEB.Biodata" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<!DOCTYPE html>
<script src="../Scripts/jquery-1.8.3.min.js"></script>
<script src="../Scripts/ASPSnippets_Pager.min.js"></script>
<script src="../Scripts/inputmask.min.js"></script>
<script src="../Scripts/inputmask.date.extensions.min.js"></script>
<script src="../Scripts/inputmask.extensions.min.js"></script>
<link rel="stylesheet" type="text/css" href="../Scripts/inputmask.css"/>
<script type="text/javascript">
jQuery(function myfuctionsula ($){
var inputmask = new Inputmask("99/99/9999", { placeholder: 'dd/mm/yyyy' });
inputmask.mask($('[id*=txtDOB]'));
});
</script>
<script type="text/javascript">
$(function () {
GetCustomers(1);
$("body").on("keyup", "[id*=txtSearch]", function () {
GetCustomers(parseInt(1));
});
$("body").on("click", ".Pager .page", function () {
GetCustomers(parseInt($(this).attr('page')));
});
});
function SearchTerm() {
return jQuery.trim($("[id*=txtSearch]").val());
};
function GetCustomers(pageIndex) {
$.ajax({
type: "POST",
url: "Biodata.aspx/GetCustomers",
data: '{searchTerm: "' + SearchTerm() + '", pageIndex: ' + pageIndex + '}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: OnSuccess,
failure: function (response) {
alert(response.d);
},
error: function (response) {
alert(response.d);
}
});
}
var row;
function OnSuccess(response) {
var xmlDoc = $.parseXML(response.d);
var xml = $(xmlDoc);
var customers = xml.find("Customers");
if (row == null) {
row = $("[id*=SearchGrid] tr:last-child").clone(true);
}
var footer = $("[id*=SearchGrid] tr:last-child").clone(true);
$("[id*=SearchGrid] tr").not($("[id*=SearchGrid] tr:first-child")).remove();
if (customers.length > 0) {
$.each(customers, function () {
var customer = $(this);
$("td", row).eq(0).html($(this).find("ADMNO").text());
$("td", row).eq(1).html($(this).find("Name").text());
$("td", row).eq(2).html($(this).find("Class").text());
$("td", row).eq(3).html($(this).find("Stream").text());
$("td", row).eq(4).html($(this).find("SEX").text());
$("td", row).eq(7).html($(this).find("STATUS").text());
$("td", row).eq(5).html($(this).find("studenttype").text());
$("td", row).eq(6).html($(this).find("House").text());
$("td", row).eq(8).html($(this).find("Fmobile").text());
$("td", row).eq(9).html("<a href='javascript:;' onclick='GetData(this)'>Select</a>");
$("[id*=SearchGrid]").append(row);
row = $("[id*=SearchGrid] tr:last-child").clone(true);
});
$("[id*=SearchGrid]").append(footer);
var pager = xml.find("Pager");
$(".Pager").ASPSnippets_Pager({
ActiveCssClass: "current",
PagerCssClass: "pager",
PageIndex: parseInt(pager.find("PageIndex").text()),
PageSize: parseInt(pager.find("PageSize").text()),
RecordCount: parseInt(pager.find("RecordCount").text())
});
$(".Name").each(function () {
var searchPattern = new RegExp('(' + SearchTerm() + ')', 'ig');
$(this).html($(this).text().replace(searchPattern, "<span class = 'highlight'>" + SearchTerm() + "</span>"));
});
} else {
var empty_row = row.clone(true);
$("td:first-child", empty_row).attr("colspan", $("td", row).length);
$("td:first-child", empty_row).attr("align", "center");
$("td:first-child", empty_row).html("No records found for the search criteria.");
$("td", empty_row).not($("td:first-child", empty_row)).remove();
$("[id*=SearchGrid]").append(empty_row);
}
};
function GetData(ele) {
var row = $(ele).closest('tr');
var id = $("td", row).eq(0).html();
var name = $("td", row).eq(1).html();
var classr = $("td", row).eq(2).html();
var streamr = $("td", row).eq(3).html();
var Fmobile = $("td", row).eq(8).html();
$('[id*=hfId]').val(id);
$('[id*=lblId]').html(id);
$('[id*=TxtFirstName]').val(name);
$('[id*=admn]').val(id);
$('[id*=ddlclass]').val(classr);
$('[id*=ddlSTREAM]').val(streamr);
$('[id*=txtmobilefa]').val(Fmobile);
}
</script>
<script type = "text/javascript">
function askConfirm(msg)
{ alert(msg)
}
</script>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<table class="auto-style70">
<tr>
<td class="auto-style43">Admno</td>
<td class="auto-style48">
<asp:HiddenField ID="hfId" runat="server" />
<asp:TextBox ID="Txtadmno" runat="server" ReadOnly="True" Width="133px"></asp:TextBox>
</td>
<td class="auto-style44">
<asp:Button ID="Button3" runat="server" Text="Get Details" />
</td>
<td class="auto-style45"> Name</td>
<td class="auto-style46">
<asp:TextBox ID="TxtFirstName" runat="server" Width="200px"></asp:TextBox>
</td>
<td class="auto-style47">Class</td>
<td class="auto-style48">
<asp:DropDownList ID="ddlclass" runat="server">
<asp:ListItem>Select</asp:ListItem>
<asp:ListItem>PRE</asp:ListItem>
<asp:ListItem>P1</asp:ListItem>
<asp:ListItem>P2</asp:ListItem>
<asp:ListItem>P3</asp:ListItem>
<asp:ListItem>P4</asp:ListItem>
<asp:ListItem>P5</asp:ListItem>
<asp:ListItem>P6</asp:ListItem>
<asp:ListItem>P7</asp:ListItem>
</asp:DropDownList>
</td>
<td class="auto-style11">Stream</td>
<td colspan="6" class="auto-style48">
<asp:DropDownList ID="ddlSTREAM" runat="server">
<asp:ListItem>Select</asp:ListItem>
<asp:ListItem>A</asp:ListItem>
<asp:ListItem>B</asp:ListItem>
<asp:ListItem>C</asp:ListItem>
<asp:ListItem>D</asp:ListItem>
<asp:ListItem>E</asp:ListItem>
<asp:ListItem>F</asp:ListItem>
<asp:ListItem>G</asp:ListItem>
<asp:ListItem>H</asp:ListItem>
<asp:ListItem>L</asp:ListItem>
</asp:DropDownList>
</td>
<td colspan="3" class="auto-style77">D.O.B</td>
<td class="auto-style48">
<asp:TextBox ID="txtDOB" runat="server" TextMode="DateTime" Width="72px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style13">Intake</td>
<td class="auto-style18">
<asp:DropDownList ID="ddlintake" runat="server" DataTextField="intake" DataValueField="intake">
<asp:ListItem>Select</asp:ListItem>
</asp:DropDownList>
</td>
<td class="auto-style14">
</td>
<td class="auto-style15" rowspan="2">Prev School</td>
<td class="auto-style16" rowspan="2">
<asp:TextBox ID="txtPrevsch" runat="server" Height="29px" Width="204px"></asp:TextBox>
</td>
<td class="auto-style17" rowspan="2">Other Kids</td>
<td class="auto-style78" colspan="6" rowspan="2">
<asp:TextBox ID="txtOtherkids" runat="server" Height="26px" Width="198px"></asp:TextBox>
</td>
<td class="auto-style72" colspan="3" rowspan="2">Religion</td>
<td class="auto-style18" colspan="3" rowspan="2"> <asp:DropDownList ID="DropDownReligion" runat="server" DataTextField="Religion" DataValueField="Religion">
<asp:ListItem Text="Please select"></asp:ListItem>
<asp:ListItem Text="NONE"></asp:ListItem>
<asp:ListItem Text="MUSLIM"></asp:ListItem>
<asp:ListItem Text="PROTESTANT"></asp:ListItem>
<asp:ListItem Text="CATHOLIC"></asp:ListItem>
</asp:DropDownList></td>
</tr>
<tr>
<td class="auto-style18" colspan="2">
Search<asp:TextBox ID="txtSearch" runat="server" Width="178px"></asp:TextBox>
</td>
<td class="auto-style14">
<asp:Button ID="Button1" runat="server" Text="Submit" />
</td>
</tr>
<tr>
<td class="auto-style27" colspan="18"><strong>Father Information Details<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
</strong></td>
</tr>
<tr>
<td class="auto-style76">Father's Name</td>
<td class="auto-style24" colspan="2">
<asp:TextBox ID="txtFather" runat="server" Width="218px"></asp:TextBox>
</td>
<td class="auto-style23">Location</td>
<td class="auto-style22">
<asp:TextBox ID="txtLocation" runat="server" Width="200px"></asp:TextBox>
</td>
<td class="auto-style21">Sub-County</td>
<td class="auto-style20" colspan="3">
<asp:TextBox ID="txtsubcounty" runat="server" Width="201px"></asp:TextBox>
</td>
<td class="auto-style20" colspan="7">County</td>
<td class="auto-style20" colspan="2">
<asp:TextBox ID="txtcounty" runat="server" Width="89px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style76">District</td>
<td class="auto-style24" colspan="2">
<asp:DropDownList ID="DropDownList2" runat="server" DataTextField="Districts" DataValueField="Districts" Height="28px" Width="232px">
</asp:DropDownList>
</td>
<td class="auto-style23">Occupation</td>
<td class="auto-style22">
<asp:TextBox ID="txtOccupation" runat="server" Width="200px"></asp:TextBox>
</td>
<td class="auto-style21">Department</td>
<td colspan="7" class="auto-style28">
<asp:TextBox ID="txtdepartment" runat="server" Width="200px"></asp:TextBox>
</td>
<td class="auto-style20" colspan="3">OfficeNo.</td>
<td class="auto-style20" colspan="2">
<asp:TextBox ID="txtofficeno" runat="server" Width="88px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style76">Mobile No.</td>
<td class="auto-style24" colspan="2">
<asp:TextBox ID="txtmobilefa" runat="server" Width="220px"></asp:TextBox>
</td>
<td class="auto-style23">MobileNo.2</td>
<td class="auto-style22">
<asp:TextBox ID="txtmobilefa2" runat="server" Width="200px"></asp:TextBox>
</td>
<td class="auto-style21">Email </td>
<td colspan="12" class="auto-style20">
<asp:TextBox ID="txtemailf" runat="server" Width="200px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style27" colspan="18"><strong>Mother's Information Details</strong></td>
</tr>
<tr>
<td class="auto-style76">Mother'sName </td>
<td class="auto-style24" colspan="2">
<asp:TextBox ID="txtMother" runat="server" Width="218px"></asp:TextBox>
</td>
<td class="auto-style23">Location</td>
<td class="auto-style22">
<asp:TextBox ID="txtMlocation" runat="server" Width="200px"></asp:TextBox>
</td>
<td class="auto-style21">Sub-County</td>
<td colspan="7" class="auto-style28">
<asp:TextBox ID="txtMsubcounty" runat="server" Width="200px"></asp:TextBox>
</td>
<td class="auto-style20" colspan="3">County</td>
<td class="auto-style20" colspan="2">
<asp:TextBox ID="txtMCounty" runat="server" Width="83px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style76">District</td>
<td class="auto-style24" colspan="2">
<asp:DropDownList ID="DropDownList3" runat="server" DataTextField="Districts" DataValueField="Districts" Height="29px" Width="226px">
</asp:DropDownList>
</td>
<td class="auto-style23">Occupation.</td>
<td class="auto-style22">
<asp:TextBox ID="txtMoccupation" runat="server" Width="200px"></asp:TextBox>
</td>
<td class="auto-style21">Office</td>
<td colspan="6" class="auto-style79">
<asp:TextBox ID="txtMoffice" runat="server" Width="200px"></asp:TextBox>
</td>
<td class="auto-style73" colspan="3">Department</td>
<td class="auto-style20" colspan="3">
<asp:TextBox ID="txtdepartmentM" runat="server" Width="106px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style76">Mobile No.</td>
<td class="auto-style24" colspan="2">
<asp:TextBox ID="txtMMobile" runat="server" Height="19px" Width="215px"></asp:TextBox>
</td>
<td class="auto-style23">Mobile No2</td>
<td class="auto-style22">
<asp:TextBox ID="txtMmobile2" runat="server" Width="200px"></asp:TextBox>
</td>
<td class="auto-style21">Email</td>
<td colspan="12" class="auto-style20">
<asp:TextBox ID="txtMemail" runat="server" Width="200px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style27" colspan="18"><strong>Next of Kin's Information Details</strong></td>
</tr>
<tr>
<td class="auto-style76">Next of Kin.</td>
<td class="auto-style24" colspan="2">
<asp:TextBox ID="txtNkin" runat="server" Width="200px"></asp:TextBox>
</td>
<td class="auto-style23">Mobile No.</td>
<td class="auto-style22">
<asp:TextBox ID="txtNmobile" runat="server" Width="200px"></asp:TextBox>
</td>
<td class="auto-style21">Mobile.No.2</td>
<td colspan="12" class="auto-style20">
<asp:TextBox ID="txtNmobile2" runat="server" Width="200px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style29" colspan="2">Are both parents Living? (No/Yes</td>
<td class="auto-style29">
<asp:CheckBox ID="CheckBox1" runat="server" />
</td>
<td class="auto-style29" colspan="2">(If not specify who is living)<asp:DropDownList ID="DropDownList4" runat="server">
<asp:ListItem>NONE</asp:ListItem>
<asp:ListItem>Father</asp:ListItem>
<asp:ListItem>Mother</asp:ListItem>
<asp:ListItem>Both</asp:ListItem>
</asp:DropDownList>
</td>
<td class="auto-style29" colspan="5">Who is responsible for Paying School fees?</td>
<td class="auto-style29" colspan="8">
<asp:TextBox ID="txtffees" runat="server" Width="252px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style68">Relation- Ship</td>
<td class="auto-style33" colspan="2">
<asp:TextBox ID="txtRelationship" runat="server" Width="200px"></asp:TextBox>
</td>
<td class="auto-style32">Occupation</td>
<td class="auto-style31">
<asp:TextBox ID="txtNoccupation" runat="server" Width="200px"></asp:TextBox>
</td>
<td class="auto-style30">Address</td>
<td colspan="5" class="auto-style29">
<asp:TextBox ID="txtNaddress" runat="server" Width="200px"></asp:TextBox>
</td>
<td class="auto-style29" colspan="4">Health</td>
<td class="auto-style29" colspan="3">
<asp:TextBox ID="Health" runat="server" Width="117px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style29" colspan="18">
<asp:GridView ID="SearchGrid" runat="server" AutoGenerateColumns="False" OnSelectedIndexChanged = "OnSelectedIndexChanged">
<Columns>
<asp:TemplateField HeaderText="ADMNO">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("ADMNO") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("ADMNO") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Student Name">
<EditItemTemplate>
<asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Name") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("Name") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Class">
<EditItemTemplate>
<asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Class") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("Class") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Stream">
<EditItemTemplate>
<asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("Stream") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%# Bind("Stream") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Sex">
<EditItemTemplate>
<asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("Sex") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label7" runat="server" Text='<%# Bind("Sex") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Student Type">
<EditItemTemplate>
<asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("studenttype") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label5" runat="server" Text='<%# Bind("studenttype") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Colour">
<EditItemTemplate>
<asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("House") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label6" runat="server" Text='<%# Bind("House") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Status">
<EditItemTemplate>
<asp:TextBox ID="TextBox8" runat="server" Text='<%# Bind("STATUS") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label8" runat="server" Text='<%# Bind("STATUS") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fmobile" >
<EditItemTemplate>
<asp:TextBox ID="TextBox9" runat="server" Text='<%# Bind("Fmobile") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label9" runat="server" Text='<%# Bind("Fmobile") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:ButtonField CommandName="Select" HeaderText="Select" Text="Select" />
</Columns>
</asp:GridView>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
Imports System.IO
Imports System.Data
Imports System.Configuration
Imports System.Data.SqlClient
Public Class Biodata
Inherits System.Web.UI.Page
Private Shared PageSize As Integer = 14
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Me.IsPostBack Then
BindDummyRow()
Dim constr As String = ConfigurationManager.ConnectionStrings("SMIS2022ConnectionString").ConnectionString
Using con As New SqlConnection(constr)
Using cmd As New SqlCommand("SELECT Districts,atk FROM Districts")
cmd.CommandType = CommandType.Text
cmd.Connection = con
con.Open()
DropDownList2.DataSource = cmd.ExecuteReader()
DropDownList2.DataTextField = "Districts"
DropDownList2.DataValueField = "atk"
DropDownList2.DataBind()
con.Close()
End Using
End Using
DropDownList2.Items.Insert(0, New ListItem("--Select District--", "0"))
Dim constr2 As String = ConfigurationManager.ConnectionStrings("SMIS2022ConnectionString").ConnectionString
Using con As New SqlConnection(constr2)
Using cmd As New SqlCommand("SELECT Districts,atk FROM Districts")
cmd.CommandType = CommandType.Text
cmd.Connection = con
con.Open()
DropDownList3.DataSource = cmd.ExecuteReader()
DropDownList3.DataTextField = "Districts"
DropDownList3.DataValueField = "atk"
DropDownList3.DataBind()
con.Close()
End Using
End Using
DropDownList3.Items.Insert(0, New ListItem("--Select District--", "0"))
End If
SearchGrid.DataBind()
End Sub
Private Sub BindDummyRow()
Dim dummy As DataTable = New DataTable()
dummy.Columns.Add("ADMNO")
dummy.Columns.Add("Name")
dummy.Columns.Add("Class")
dummy.Columns.Add("Stream")
dummy.Columns.Add("sex")
dummy.Columns.Add("Status")
dummy.Columns.Add("studenttype")
dummy.Columns.Add("House")
dummy.Columns.Add("Fmobile")
dummy.Rows.Add()
SearchGrid.DataSource = dummy
SearchGrid.DataBind()
'sample()
End Sub
<System.Web.Services.WebMethod()>
Public Shared Function GetCustomers(ByVal searchTerm As String, ByVal pageIndex As Integer) As String
Dim query As String = "[GetCustomers_Pager2022]"
Dim cmd As SqlCommand = New SqlCommand(query)
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.AddWithValue("@SearchTerm", searchTerm)
cmd.Parameters.AddWithValue("@PageIndex", pageIndex)
cmd.Parameters.AddWithValue("@PageSize", 14)
cmd.Parameters.Add("@RecordCount", SqlDbType.Int, 4).Direction = ParameterDirection.Output
Return GetData(cmd, pageIndex).GetXml()
End Function
Private Shared Function GetData(ByVal cmd As SqlCommand, ByVal pageIndex As Integer) As DataSet
Dim strConnString As String = ConfigurationManager.ConnectionStrings("SMIS2022ConnectionString").ConnectionString
Using con As SqlConnection = New SqlConnection(strConnString)
Using sda As SqlDataAdapter = New SqlDataAdapter()
cmd.Connection = con
sda.SelectCommand = cmd
Using ds As DataSet = New DataSet()
sda.Fill(ds, "Customers")
Dim dt As DataTable = New DataTable("Pager")
dt.Columns.Add("PageIndex")
dt.Columns.Add("PageSize")
dt.Columns.Add("RecordCount")
dt.Rows.Add()
dt.Rows(0)("PageIndex") = pageIndex
dt.Rows(0)("PageSize") = 14
dt.Rows(0)("RecordCount") = cmd.Parameters("@RecordCount").Value
ds.Tables.Add(dt)
Return ds
End Using
End Using
End Using
End Function
Protected Sub SearchGrid_SelectedIndexChanged(sender As Object, e As EventArgs) Handles SearchGrid.SelectedIndexChanged
Try
Dim index As Integer = SearchGrid.SelectedIndex
Dim gvRow As GridViewRow = SearchGrid.Rows(index)
Dim named As String = SearchGrid.SelectedRow.Cells(0).Text
' Response.Redirect(String.Format("~/Forms/EditRegistration.aspx?account={0}", named))
Catch ex As Exception
End Try
End Sub
Protected Sub OnSelectedIndexChanged(sender As Object, e As EventArgs)
'Accessing BoundField Column.
Dim name As String = SearchGrid.SelectedRow.Cells(0).Text
'Accessing TemplateField Column controls.
' Dim country As String = TryCast(GridView1.SelectedRow.FindControl("lblCountry"), Label).Text
' lblValues.Text = "<b>Name:</b> " & name & " <b>Country:</b> " & country
End Sub
Protected Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
If String.IsNullOrEmpty(hfId.Value) Then
ScriptManager.RegisterStartupScript(Me, [GetType](), "showalert", "alert('You Must Indicate Student Admno Number and Name to countinue!!!!');", True)
Exit Sub
Else
Dim idt As String = hfId.Value
Dim strConnString As String = ConfigurationManager.ConnectionStrings("SMIS2022ConnectionString").ConnectionString
Using con As SqlConnection = New SqlConnection(strConnString)
Using cmd As SqlCommand = New SqlCommand()
cmd.Connection = con
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "StudentDataDetails"
cmd.Parameters.AddWithValue("@c", idt)
cmd.Connection = con
con.Open()
Dim sdr As SqlDataReader = cmd.ExecuteReader()
sdr.Read()
TxtFirstName.Text = sdr("Name").ToString()
ddlclass.SelectedItem.Text = sdr("Class").ToString()
ddlSTREAM.SelectedItem.Text = sdr("Stream").ToString()
txtFather.Text = sdr("Father").ToString()
txtMother.Text = sdr("Mother").ToString()
txtmobilefa.Text = sdr("Fmobile").ToString()
Txtadmno.Text = sdr("admno").ToString()
txtMMobile.Text = sdr("mMobile").ToString()
DropDownList2.SelectedItem.Text = sdr("District").ToString()
DropDownList3.SelectedItem.Text = sdr("District1").ToString()
' txtMmobile2.Text = sdr("Mothercontact").ToString()
txtLocation.Text = sdr("Location").ToString()
txtemailf.Text = sdr("femail").ToString()
txtPrevsch.Text = sdr("Pschool").ToString()
txtDOB.Text = sdr("Dbirth").ToString()
txtemailf.Text = sdr("Femail").ToString()
txtLocation.Text = sdr.Item("location").ToString
txtsubcounty.Text = sdr.Item("sub").ToString
txtcounty.Text = sdr.Item("county").ToString
txtOccupation.Text = sdr.Item("occupation").ToString
txtdepartment.Text = sdr.Item("dpt").ToString
txtmobilefa2.Text = sdr.Item("Mobilephone").ToString
txtofficeno.Text = sdr.Item("offs").ToString
txtemailf.Text = sdr.Item("email").ToString
txtMother.Text = sdr.Item("mother").ToString
txtffees.Text = sdr.Item("live1").ToString
DropDownList4.SelectedItem.Text = sdr.Item("live").ToString
DropDownReligion.SelectedItem.Text = sdr.Item("Religion").ToString
txtOtherkids.Text = sdr.Item("child").ToString
txtMlocation.Text = sdr.Item("location1").ToString
txtMsubcounty.Text = sdr.Item("sub1").ToString
txtMCounty.Text = sdr.Item("county1").ToString
txtMoccupation.Text = sdr.Item("occupation1").ToString
txtdepartmentM.Text = sdr.Item("dpt1").ToString
txtMoffice.Text = sdr.Item("offs1").ToString
txtMmobile2.Text = sdr.Item("mob1").ToString
txtMemail.Text = sdr.Item("email2").ToString
txtNkin.Text = sdr.Item("nkin").ToString
txtNmobile.Text = sdr.Item("mob").ToString
txtNmobile2.Text = sdr.Item("mobilenew").ToString
txtRelationship.Text = sdr.Item("rname").ToString
txtNoccupation.Text = sdr.Item("roccupation").ToString
txtNaddress.Text = sdr.Item("padd").ToString
Health.Text = sdr.Item("health").ToString
con.Close()
' ScriptManager.RegisterStartupScript(Me, Me.[GetType](), "showalert", "alert('Data Loaded Successfully Thank You');window.location ='" + Request.Url.AbsoluteUri + "';", True)
SearchGrid.DataBind()
End Using
End Using
End If
End Sub
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If String.IsNullOrEmpty(txtDOB.Text) Then
ScriptManager.RegisterStartupScript(Me, [GetType](), "showalert", "alert('You Must Indicate Student Date of Birth!!!!');", True)
txtDOB.Focus()
Exit Sub
Else
' Load basic
Dim Namesr As String = TxtFirstName.Text
Dim classesr As String = ddlclass.SelectedItem.Text
Dim streams As String = ddlSTREAM.SelectedItem.Text
Dim Dobsr As DateTime = txtDOB.Text
Dim Yers As String = ""
Dim NOd As String = ""
Dim intak As String = ddlintake.SelectedItem.Text
Dim Prevs As String = txtPrevsch.Text
Dim formn As String = ""
Dim admn As String = hfId.Value
Dim childs As String = txtOtherkids.Text
'load father
Dim fath As String = txtFather.Text
Dim fresidence As String = txtLocation.Text
Dim fsubcounty As String = txtsubcounty.Text
Dim fcounty As String = txtcounty.Text
Dim distr As String = DropDownList2.SelectedItem.Text
Dim fdepartment As String = txtdepartment.Text
Dim ocup As String = txtOccupation.Text
Dim fmobile As String = txtmobilefa.Text
Dim fmobile2 As String = txtmobilefa2.Text
Dim ffemails As String = txtemailf.Text
' load Mothers Details
Dim moth As String = txtMother.Text
Dim mresid As String = txtMlocation.Text
Dim msubcounty As String = txtMsubcounty.Text
Dim mcount As String = txtcounty.Text
Dim mdistrict As String = DropDownList3.SelectedItem.Text
Dim mdepart As String = txtdepartmentM.Text
Dim mmobile As String = txtMMobile.Text
Dim mmobile2 As String = txtMmobile2.Text
Dim emil As String = txtMemail.Text
Dim occupat As String = txtMoccupation.Text
' Load Nkin
Dim kin As String = txtNkin.Text
Dim kinmobiled As String = txtNmobile.Text
Dim kimobile2 As String = txtNmobile2.Text
Dim related As String = txtRelationship.Text
Dim kindress As String = txtNaddress.Text
Dim resfees As String = txtffees.Text
Dim roccupation As String = txtOccupation.Text
Dim rlive As String = DropDownList4.SelectedItem.Text
'load health
Dim healthy As String = Health.Text
Dim constr As String = ConfigurationManager.ConnectionStrings("SMIS2022ConnectionString").ConnectionString
Using con As SqlConnection = New SqlConnection(constr)
Using cmd As New SqlCommand("UPDATE P3P7 set Name=@Name, class=@class,stream=@stream,intake=@intake,admno=@admno,fno=@fno,category=@category,date=@date,pschool=@pschool,Dbirth=@dbirth,yeara=@yeara,child=@child,pname=@pname,location=@location,sub=@sub,county=@county,district=@dis,Occupation=@ocu,dpt=@dpt,Contact=@contact,offs=@offs,email=@email,Mother=@mother,Location1=@location1,sub1=@sub1,county1=@county1,District1=@district1,Occupation1=@occupation1,dpt1=@dpt1,offs1=@offs1,mob1=@mob1,email2=@email2,Nkin=@nkin,mob=@mob,mobilenew=@mobilenew,rname=@rname,padd=@padd,live1=@live1,health=@health,roccupation=@roccupation,live=@live,Fmobile=@fmobile,Mmobile=@mmobile,Mobilephone=@fmobile2,Religion=@Religion where admno = @admno")
cmd.CommandTimeout = 5000000
cmd.Parameters.AddWithValue("@Name", Namesr)
cmd.Parameters.AddWithValue("@Class", classesr)
cmd.Parameters.AddWithValue("@stream", streams)
cmd.Parameters.AddWithValue("@intake", intak)
cmd.Parameters.AddWithValue("@admno", admn)
cmd.Parameters.AddWithValue("@fno", formn)
cmd.Parameters.AddWithValue("@category", NOd)
' cmd.Parameters.AddWithValue("@date", DateAndTime.Now)
cmd.Parameters.Add("@date", SqlDbType.DateTime).Value = DateAndTime.Now
cmd.Parameters.AddWithValue("@pschool", Prevs)
cmd.Parameters.AddWithValue("@Fmobile", txtmobilefa.Text)
cmd.Parameters.AddWithValue("@Fmobile2", txtmobilefa2.Text)
cmd.Parameters.AddWithValue("@mmobile", txtMMobile.Text)
cmd.Parameters.Add("@dbirth", SqlDbType.DateTime).Value = Dobsr
cmd.Parameters.AddWithValue("@yeara", Yers)
cmd.Parameters.AddWithValue("@child", childs)
'load father
cmd.Parameters.AddWithValue("@pname", fath)
cmd.Parameters.AddWithValue("@location", fresidence)
cmd.Parameters.AddWithValue("@sub", fsubcounty)
cmd.Parameters.AddWithValue("@county", fcounty)
cmd.Parameters.AddWithValue("@dis", distr)
cmd.Parameters.AddWithValue("@ocu", ocup)
cmd.Parameters.AddWithValue("@dpt", fdepartment)
cmd.Parameters.AddWithValue("@Contact", fmobile)
cmd.Parameters.AddWithValue("@offs", txtofficeno.Text)
cmd.Parameters.AddWithValue("@email", ffemails)
'loadmother
cmd.Parameters.AddWithValue("@Mother", moth)
cmd.Parameters.AddWithValue("@Location1", mresid)
cmd.Parameters.AddWithValue("@sub1", msubcounty)
cmd.Parameters.AddWithValue("@county1", mcount)
cmd.Parameters.AddWithValue("@District1", mdistrict)
cmd.Parameters.AddWithValue("@Occupation1", occupat)
cmd.Parameters.AddWithValue("@dpt1", mdepart)
cmd.Parameters.AddWithValue("@offs1", mmobile)
cmd.Parameters.AddWithValue("@mob1", txtMoffice.Text)
cmd.Parameters.AddWithValue("@email2", emil)
'loadnkin
cmd.Parameters.AddWithValue("@Nkin", kin)
cmd.Parameters.AddWithValue("@mob", kinmobiled)
cmd.Parameters.AddWithValue("@mobilenew", kimobile2)
cmd.Parameters.AddWithValue("@rname", related)
cmd.Parameters.AddWithValue("@padd", kindress)
cmd.Parameters.AddWithValue("@live1", resfees)
cmd.Parameters.AddWithValue("@health", healthy)
cmd.Parameters.AddWithValue("@roccupation", roccupation)
cmd.Parameters.AddWithValue("@Religion", DropDownReligion.SelectedItem.Text)
cmd.Parameters.AddWithValue("@live", rlive)
cmd.Connection = con
con.Open()
cmd.ExecuteNonQuery()
con.Close()
' Thread.Sleep(1000)
' Response.Write("<script>alert('Data Successfully Updated Thank You');</script>")
'ScriptManager.RegisterStartupScript(Me, Me.GetType(), "askConfirmk", "alert('Data Successfully Updated Thank You! ... !!')", True)
ScriptManager.RegisterStartupScript(Me, Me.[GetType](), "showalert", "alert('Data Successfully Updated Thank You');window.location ='" + Request.Url.AbsoluteUri + "';", True)
'Wizard1.ActiveStepIndex = 0
Exit Sub
End Using
End Using
End If
End Sub
End Class
Dateinput Mask does not show when i click on this
Protected Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
If String.IsNullOrEmpty(hfId.Value) Then
ScriptManager.RegisterStartupScript(Me, [GetType](), "showalert", "alert('You Must Indicate Student Admno Number and Name to countinue!!!!');", True)
Exit Sub
Else
Dim idt As String = hfId.Value
Dim strConnString As String = ConfigurationManager.ConnectionStrings("SMIS2022ConnectionString").ConnectionString
Using con As SqlConnection = New SqlConnection(strConnString)
Using cmd As SqlCommand = New SqlCommand()
cmd.Connection = con
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "StudentDataDetails"
cmd.Parameters.AddWithValue("@c", idt)
cmd.Connection = con
con.Open()
Dim sdr As SqlDataReader = cmd.ExecuteReader()
sdr.Read()
TxtFirstName.Text = sdr("Name").ToString()
ddlclass.SelectedItem.Text = sdr("Class").ToString()
ddlSTREAM.SelectedItem.Text = sdr("Stream").ToString()
txtFather.Text = sdr("Father").ToString()
txtMother.Text = sdr("Mother").ToString()
txtmobilefa.Text = sdr("Fmobile").ToString()
Txtadmno.Text = sdr("admno").ToString()
txtMMobile.Text = sdr("mMobile").ToString()
DropDownList2.SelectedItem.Text = sdr("District").ToString()
DropDownList3.SelectedItem.Text = sdr("District1").ToString()
' txtMmobile2.Text = sdr("Mothercontact").ToString()
txtLocation.Text = sdr("Location").ToString()
txtemailf.Text = sdr("femail").ToString()
txtPrevsch.Text = sdr("Pschool").ToString()
txtDOB.Text = sdr("Dbirth").ToString()
txtemailf.Text = sdr("Femail").ToString()
txtLocation.Text = sdr.Item("location").ToString
txtsubcounty.Text = sdr.Item("sub").ToString
txtcounty.Text = sdr.Item("county").ToString
txtOccupation.Text = sdr.Item("occupation").ToString
txtdepartment.Text = sdr.Item("dpt").ToString
txtmobilefa2.Text = sdr.Item("Mobilephone").ToString
txtofficeno.Text = sdr.Item("offs").ToString
txtemailf.Text = sdr.Item("email").ToString
txtMother.Text = sdr.Item("mother").ToString
txtffees.Text = sdr.Item("live1").ToString
DropDownList4.SelectedItem.Text = sdr.Item("live").ToString
DropDownReligion.SelectedItem.Text = sdr.Item("Religion").ToString
txtOtherkids.Text = sdr.Item("child").ToString
txtMlocation.Text = sdr.Item("location1").ToString
txtMsubcounty.Text = sdr.Item("sub1").ToString
txtMCounty.Text = sdr.Item("county1").ToString
txtMoccupation.Text = sdr.Item("occupation1").ToString
txtdepartmentM.Text = sdr.Item("dpt1").ToString
txtMoffice.Text = sdr.Item("offs1").ToString
txtMmobile2.Text = sdr.Item("mob1").ToString
txtMemail.Text = sdr.Item("email2").ToString
txtNkin.Text = sdr.Item("nkin").ToString
txtNmobile.Text = sdr.Item("mob").ToString
txtNmobile2.Text = sdr.Item("mobilenew").ToString
txtRelationship.Text = sdr.Item("rname").ToString
txtNoccupation.Text = sdr.Item("roccupation").ToString
txtNaddress.Text = sdr.Item("padd").ToString
Health.Text = sdr.Item("health").ToString
con.Close()
' ScriptManager.RegisterStartupScript(Me, Me.[GetType](), "showalert", "alert('Data Loaded Successfully Thank You');window.location ='" + Request.Url.AbsoluteUri + "';", True)
SearchGrid.DataBind()
End Using
End Using
End If
End Sub