Please help i am trying to display popup display but it does not close and it remains on the page please help
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/FormsV2/Site1.Master" CodeBehind="StudentSearch.aspx.vb" Inherits="SMIS2022WEB.StudentSearch1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet">
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.3/js/bootstrap.min.js" type="text/javascript"></script>
<script src="http://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="http://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<script src="../Scripts/ASPSnippets_Pager.min.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<table class="auto-style6">
<tr>
<td>Student Search
<asp:TextBox ID="txtSearch" runat="server"></asp:TextBox>
<asp:Button ID="Button2" runat="server" Text="Back To Menu" />
</td>
<td> </td>
</tr>
<tr>
<td colspan="2">
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<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: "StudentSearch.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(5).html($(this).find("STATUS").text());
$("td", row).eq(6).html($(this).find("studenttype").text());
$("td", row).eq(7).html($(this).find("House").text());
$("td", row).eq(8).html($(this).find("Lin").text());
$("td", row).eq(9).html($(this).find("NIN").text());
$("td", row).eq(10).html($(this).find("paycode").text());
$("td", row).eq(11).html($(this).find("Religion").text());
$("td", row).eq(12).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 city = $("td", row).eq(2).html();
var country = $("td", row).eq(3).html();
var Sex = $("td", row).eq(4).html();
var Stats = $("td", row).eq(5).html();
var stdtype = $("td", row).eq(6).html();
var House = $("td", row).eq(7).html();
var Lin = $("td", row).eq(8).html();
var Nin = $("td", row).eq(9).html();
var pay = $("td", row).eq(10).html();
var religion = $("td", row).eq(11).html();
$('[id*=hfId]').val(id);
$('[id*=lblId]').html(id);
$('[id*=txtName]').val(name);
$('[id*=ddlClass]').val(city);
$('[id*=txtCountry]').val(country);
$('[id*=txtCity]').val(Stats);
$('[id*=txtHouse]').val(House);
$('[id*=admno]').val(id);
$('[id*=ddlsex]').val(Sex);
$('[id*=txtLIN]').val(Lin);
$('[id*=txtNIN]').val(Nin);
$('[id*=txtPay]').val(pay);
$('[id*=ddlStudentType]').val(stdtype);
$('[id*=DropDownReligion]').val(religion);
$('[id*=myModal]').modal('show');
}
</script>
<asp:Panel ID="Panel1" runat="server" Style="background-color: #FFFFFF; margin-bottom: 0px;" Height="500px" BorderColor="#6699FF" BorderStyle="Double" Font-Size="Medium">
<asp:GridView ID="SearchGrid" runat="server" AutoGenerateColumns="False" Height="274px" ItemStyle-Width="Auto" PageSize="18" ShowFooter="True" ShowHeaderWhenEmpty="True" Width="1121px">
<Columns>
<asp:TemplateField HeaderText="Admno">
<EditItemTemplate>
<asp:TextBox ID="txtadmno" runat="server" Text='<%# Bind("ADMNO") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lbladmno" runat="server" Text='<%# Bind("ADMNO") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Student Name">
<EditItemTemplate>
<asp:TextBox ID="txtName0" runat="server"></asp:TextBox>
</EditItemTemplate>
<FooterTemplate>
<asp:TextBox ID="txtContactName" runat="server" Text='<%# Eval("Name") %>' Width="335px"></asp:TextBox>
</FooterTemplate>
<ItemTemplate>
<asp:Label ID="lblContactName" runat="server" Text='<%# Eval("Name") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Class">
<EditItemTemplate>
<asp:TextBox ID="txtCity0" runat="server" Text='<%# Bind("Class") %>'></asp:TextBox>
</EditItemTemplate>
<FooterTemplate>
<asp:DropDownList ID="ClassDropListsF" runat="server">
<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>
</FooterTemplate>
<ItemTemplate>
<asp:Label ID="lblCity" runat="server" Text='<%# Bind("Class") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Stream">
<EditItemTemplate>
<asp:TextBox ID="txtCountry0" runat="server" Text='<%# Bind("Strean") %>'></asp:TextBox>
</EditItemTemplate>
<FooterTemplate>
<asp:DropDownList ID="StreamDropListsF" runat="server" DataSourceID="Sqlstream" DataTextField="Stream" DataValueField="Stream">
</asp:DropDownList>
<asp:SqlDataSource ID="Sqlstream" runat="server" ConnectionString="<%$ ConnectionStrings:SMIS2022ConnectionString %>" SelectCommand="SELECT [Stream] FROM [Streamdata]"></asp:SqlDataSource>
</FooterTemplate>
<ItemTemplate>
<asp:Label ID="lblCountry" runat="server" Text='<%# Bind("Stream") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Sex">
<EditItemTemplate>
<asp:TextBox ID="Sex" runat="server"></asp:TextBox>
</EditItemTemplate>
<FooterTemplate>
<asp:DropDownList ID="SexDropListsF" runat="server">
<asp:ListItem>NONE</asp:ListItem>
<asp:ListItem>MALE</asp:ListItem>
<asp:ListItem>FEMALE</asp:ListItem>
</asp:DropDownList>
</FooterTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("Sex") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Status">
<EditItemTemplate>
<asp:TextBox ID="TextBox2" runat="server" Height="21px" Width="196px"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Eval("Status") %>' Width="135px"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Student Type">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</EditItemTemplate>
<FooterTemplate>
<asp:DropDownList ID="STDDropListsF" runat="server">
<asp:ListItem>DAY</asp:ListItem>
</asp:DropDownList>
</FooterTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Eval("studenttype") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="House">
<EditItemTemplate>
<asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("House") %>'></asp:TextBox>
</EditItemTemplate>
<FooterTemplate>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click1" Text="Add New" />
</FooterTemplate>
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%# Eval("House") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Lin">
<EditItemTemplate>
<asp:TextBox ID="Lin" runat="server" Text='<%# Bind("Lin") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label5" runat="server" Text='<%# Bind("Lin") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Nin">
<EditItemTemplate>
<asp:TextBox ID="Nin" runat="server" Text='<%# Bind("NIN") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label6" runat="server" Text='<%# Bind("NIN") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="PayCode">
<EditItemTemplate>
<asp:TextBox ID="TextBox4" runat="server"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label7" runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Religion">
<EditItemTemplate>
<asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("Religion") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label8" runat="server" Text='<%# Bind("Religion") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:ButtonField CommandName="Staff" HeaderText="Select" Text="Select" />
</Columns>
</asp:GridView>
</asp:Panel>
<div class="Pager"></div>
<div id="myModal" class="modal fade" style="width: auto;">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button style="padding: 0px" type="button" data-dismiss="modal">×</button>
</div>
<div class="modal-body">
<div>
<div class="form-group">
</div>
<div class="form-group">
<div class="form-group">
<asp:HiddenField ID="hfId" runat="server" />
<asp:Label ID="Label5" runat="server"></asp:Label>
</div>
<tr>
<td>
<table>
<tr>
<td class="auto-style3">
<table class="auto-style2">
<tr>
<td class="auto-style4">Admno</td>
<td>
<div class="auto-style6">
<asp:Label ID="lblId" runat="server"></asp:Label>
<asp:TextBox ID="admno" runat="server" Visible="False"></asp:TextBox>
</div>
</td>
<td rowspan="7">
<asp:Panel ID="Panel2" runat="server" Height="162px">
</asp:Panel>
</td>
</tr>
</tr>
<tr>
<td class="auto-style4">Student Name</td>
<td>
<asp:TextBox ID="txtName" runat="server" Width="329px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style4">Class</td>
<td>
<asp:DropDownList ID="ddlClass" runat="server" DataTextField="Class" DataValueField="Class">
<asp:ListItem Text="Please select"></asp:ListItem>
<asp:ListItem Text="PRE"></asp:ListItem>
<asp:ListItem Text="P1"></asp:ListItem>
<asp:ListItem Text="P2"></asp:ListItem>
<asp:ListItem Text="P3"></asp:ListItem>
<asp:ListItem Text="P4"></asp:ListItem>
<asp:ListItem Text="P5"></asp:ListItem>
<asp:ListItem Text="P6"></asp:ListItem>
<asp:ListItem Text="P7"></asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td class="auto-style4">Stream</td>
<td>
<asp:TextBox ID="txtCountry" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style4">Status</td>
<td>
<asp:TextBox ID="txtCity" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style4">House</td>
<td>
<asp:TextBox ID="txtHouse" runat="server"></asp:TextBox>
</td>
<td class="auto-style4">House</td>
<td>
<asp:TextBox ID="TextBox4" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style4">Lin</td>
<td>
<asp:TextBox ID="txtLIN" runat="server"></asp:TextBox>
</td>
<td class="auto-style4">lin</td>
<td>
<asp:TextBox ID="TextBox7" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style4">Nin</td>
<td>
<asp:TextBox ID="txtNIN" runat="server"></asp:TextBox>
</td>
<td class="auto-style4">Nin</td>
<td>
<asp:TextBox ID="TextBox8" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style4">Paycode</td>
<td>
<asp:TextBox ID="txtPay" runat="server"></asp:TextBox>
</td>
<td class="auto-style4">Paycode</td>
<td>
<asp:TextBox ID="TextBox6" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style4">Sex</td>
<td>
<asp:DropDownList ID="ddlsex" runat="server" DataTextField="SEX" DataValueField="SEX">
<asp:ListItem Text="Please select"></asp:ListItem>
<asp:ListItem Text="MALE"></asp:ListItem>
<asp:ListItem Text="FEMALE"></asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td class="auto-style4">Student Type</td>
<td>
<asp:DropDownList ID="ddlStudentType" runat="server" DataTextField="studenttype" DataValueField="studenttype">
<asp:ListItem Text="Please select"></asp:ListItem>
<asp:ListItem Text="DAY"></asp:ListItem>
<asp:ListItem Text="BOARDER"></asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td class="auto-style4">Religion</td>
<td>
<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>
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-info" data-dismiss="modal" type="button">
Close
</button>
<asp:Button ID="btnSubmit" runat="server" CssClass="btn btn-success" OnClick="Submit" Text="Submit" />
</div>
</div>
</div>
</div>
</body>
</html>
</td>
</tr>
</table>
</asp:Content>
Imports System.IO
Imports System.Data
Imports System.Configuration
Imports System.Data.SqlClient
Public Class StudentSearch1
Inherits System.Web.UI.Page
Private Shared PageSize As Integer = 25
Dim conString As String = ConfigurationManager.ConnectionStrings("SMIS2022ConnectionString").ConnectionString
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
BindDummyRow()
SearchGrid.DataBind()
End If
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("Nin")
dummy.Columns.Add("LIN")
dummy.Columns.Add("Religion")
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", 25)
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") = 10
dt.Rows(0)("RecordCount") = cmd.Parameters("@RecordCount").Value
ds.Tables.Add(dt)
Return ds
End Using
End Using
End Using
End Function
Protected Sub Submit(ByVal sender As Object, ByVal e As EventArgs)
If String.IsNullOrEmpty(txtName.Text) Then
ScriptManager.RegisterStartupScript(Me, [GetType](), "showalert", "alert('Student Name Can not be empty');", True)
Exit Sub
Else
Dim idt As String = hfId.Value
Dim id As String = lblId.Text
Dim admnor As String = idt
Dim city As String = txtCity.Text
Dim country As String = txtCountry.Text
Dim classr As String = ddlClass.SelectedItem.Text
Dim sexr As String = ddlsex.SelectedItem.Text
Dim stdtype As String = ddlStudentType.SelectedItem.Text
Dim religion As String = DropDownReligion.SelectedItem.Text
Dim statusd As String = txtCity.Text
Dim names As String = txtName.Text
Dim housed As String = txtHouse.Text
Dim Nin As String = txtNIN.Text
Dim Lin As String = txtLIN.Text
Dim Paycode As String = txtPay.Text
Using Conb As New SqlConnection(conString)
Conb.Open()
Using cmd As New SqlCommand
cmd.Connection = Conb
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "UpdateAccounts"
cmd.Parameters.Add("@ac", SqlDbType.NVarChar).Value = admnor
cmd.Parameters.Add("@n", SqlDbType.NVarChar).Value = names
cmd.Parameters.Add("@c", SqlDbType.NVarChar).Value = classr
cmd.Parameters.Add("@s", SqlDbType.NVarChar).Value = txtCountry.Text
cmd.Parameters.Add("@st", SqlDbType.NVarChar).Value = statusd
cmd.Parameters.Add("@sx", SqlDbType.NVarChar).Value = sexr
cmd.Parameters.Add("@h", SqlDbType.NVarChar).Value = housed
cmd.Parameters.Add("@ty", SqlDbType.NVarChar).Value = stdtype
cmd.Parameters.Add("@nn", SqlDbType.NVarChar).Value = Nin
cmd.Parameters.Add("@li", SqlDbType.NVarChar).Value = Lin
cmd.Parameters.Add("@p", SqlDbType.NVarChar).Value = Paycode
cmd.Parameters.Add("@r", SqlDbType.NVarChar).Value = religion
cmd.ExecuteReader()
End Using
End Using
Response.Redirect(Request.Url.AbsoluteUri)
End If
End Sub
Protected Sub SearchGrid_SelectedIndexChanged(sender As Object, e As EventArgs) Handles SearchGrid.SelectedIndexChanged
End Sub
Protected Sub Button1_Click1(sender As Object, e As EventArgs)
Dim txtContactName As String = DirectCast(SearchGrid.FooterRow.FindControl("txtContactName"), TextBox).Text
Dim ClassDropListsF As String = DirectCast(SearchGrid.FooterRow.FindControl("ClassDropListsF"), DropDownList).SelectedValue
Dim StreamDropListsF As String = DirectCast(SearchGrid.FooterRow.FindControl("StreamDropListsF"), DropDownList).SelectedValue
Dim SexDropListsF As String = DirectCast(SearchGrid.FooterRow.FindControl("SexDropListsF"), DropDownList).SelectedValue
Dim STDDropListsF As String = DirectCast(SearchGrid.FooterRow.FindControl("STDDropListsF"), DropDownList).SelectedValue
' Dim fsaleprice As String = DirectCast(gvCustomers.FooterRow.FindControl("fsaleprice"), TextBox).Text
' Dim fsubcategory As String = DirectCast(gvCustomers.FooterRow.FindControl("fddlsubcategory"), DropDownList).SelectedValue
' Dim fclass As String = DirectCast(gvCustomers.FooterRow.FindControl("ddlclass"), DropDownList).SelectedValue
If txtContactName = "" Then
'ScriptManager.RegisterStartupScript(Me, [GetType](), "showalert", "alert('You Must Indicate Student Name');", True)
ScriptManager.RegisterStartupScript(Me, Me.[GetType](), "showalert", "alert('You Must Indicate Student Name');window.location ='" + Request.Url.AbsoluteUri + "';", True)
DirectCast(SearchGrid.FooterRow.FindControl("txtContactName"), TextBox).Focus()
Exit Sub
Else
Using Cont As New SqlConnection(conString)
Cont.Open()
Using cmd As New SqlCommand
cmd.Connection = Cont
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "createaccounts"
cmd.Parameters.Add("@n", SqlDbType.NVarChar).Value = txtContactName
cmd.Parameters.Add("@cl", SqlDbType.NVarChar).Value = ClassDropListsF
cmd.Parameters.Add("@str", SqlDbType.NVarChar).Value = StreamDropListsF
cmd.Parameters.Add("@s", SqlDbType.NVarChar).Value = SexDropListsF
cmd.Parameters.Add("@st", SqlDbType.NVarChar).Value = STDDropListsF
cmd.ExecuteReader()
Cont.Close()
End Using
End Using
' ScriptManager.RegisterStartupScript(Me, [GetType](), "showalert", "alert('Record Saved Successfully');", True)
ScriptManager.RegisterStartupScript(Me, Me.[GetType](), "showalert", "alert('Record Saved Successfully');window.location ='" + Request.Url.AbsoluteUri + "';", True)
DirectCast(SearchGrid.FooterRow.FindControl("txtContactName"), TextBox).Text = ""
DirectCast(SearchGrid.FooterRow.FindControl("ClassDropListsF"), DropDownList).ClearSelection()
DirectCast(SearchGrid.FooterRow.FindControl("StreamDropListsF"), DropDownList).ClearSelection()
DirectCast(SearchGrid.FooterRow.FindControl("SexDropListsF"), DropDownList).ClearSelection()
DirectCast(SearchGrid.FooterRow.FindControl("STDDropListsF"), DropDownList).ClearSelection()
' Dim fsaleprice As String = Di
End If
End Sub
Private Sub StudentSearch_Unload(sender As Object, e As EventArgs) Handles Me.Unload
Using Con As New SqlConnection(conString)
Con.Open()
Using cmd As New SqlCommand
cmd.Connection = Con
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "activatedatadistribute"
cmd.CommandTimeout = "500"
cmd.ExecuteReader()
Con.Close()
End Using
End Using
End Sub
Protected Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Response.Redirect(String.Format("~/MenuAcademics.aspx"))
End Sub
End Class