In ASPX page:
<script type="text/javascript">
var pageUrl = '<%=ResolveUrl("~/BOLSup.aspx")%>'
function PopulateRecLoc() {
$("#<%=comboFacility.ClientID%>").attr("disabled", "disabled");
if ($('#<%=comboRecievingLocation.ClientID%>').val() == "0") {
$('#<%=comboFacility.ClientID %>').empty().append('<option selected="selected" value="0">Select</option>');
}
else {
$('#<%=comboFacility.ClientID %>').empty().append('<option selected="selected" value="0">Loading...</option>');
var reclocid = $('#<%=comboRecievingLocation.ClientID%>').val()
$("#<%= hdnreclocid.ClientID %>").val(reclocid);
var hval = document.getElementById('<%=hdnreclocid.ClientID %>').value;
$.ajax({
type: "POST",
url: pageUrl + '/PopulateFacility',
data: '{RecLocId: ' + $('#<%=comboRecievingLocation.ClientID%>').val() + '}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function OnCountriesPopulated(response) {
PopulateControl(response.d, $("#<%=comboFacility.ClientID %>"));
},
failure: function (response) {
alert(response.d);
}
});
}
function PopulateControl(list, control) {
if (list.length > 0) {
control.removeAttr("disabled");
control.empty().append('<option selected="selected" value="0">Select</option>');
$.each(list, function () {
control.append($("<option></option>").val(this['Value']).html(this['Text']));
});
}
else {
control.empty().append('<option selected="selected" value="0">Not available<option>');
}
}
</script>
<asp:DropDownList runat="server" ID="comboRecievingLocation" Width="205Px" onchange="PopulateRecLoc()"
CausesValidation="false">
</asp:DropDownList>
Imports System
Imports System.Collections.Generic
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Configuration
Imports System.Data.SqlClient
Imports System.Data
Imports System.Collections
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Collections.Specialized
Imports AjaxControlToolkit
Imports System.Web.SessionState
Public Class BOLSup
Inherits System.Web.UI.Page
Implements IRequiresSessionState
<System.Web.Services.WebMethod()> _
Public Shared Function PopulateFacility(ByVal RecLocId As Integer) As ArrayList
Dim list As ArrayList = New ArrayList
Dim strConnString As String = ConfigurationManager.ConnectionStrings("SurgereConnection").ConnectionString
Dim strQuery As String = "select facility_id,facility_name from Facility where facility_type<>'Consolidation Center' and location_id=@location_id"
Dim con As SqlConnection = New SqlConnection(strConnString)
Dim cmd As SqlCommand = New SqlCommand
cmd.CommandType = CommandType.Text
cmd.Parameters.AddWithValue("@location_id", RecLocId)
cmd.CommandText = strQuery
cmd.Connection = con
con.Open()
Dim sdr As SqlDataReader = cmd.ExecuteReader
While sdr.Read
list.Add(New ListItem(sdr("facility_name").ToString, sdr("facility_id").ToString))
End While
con.Close()
Return list
End Function
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
<script type="text/javascript">
var pageUrl = '<%=ResolveUrl("~/BOLSup.aspx")%>'
function PopulateRecLoc() {
$("#<%=comboFacility.ClientID%>").attr("disabled", "disabled");
if ($('#<%=comboRecievingLocation.ClientID%>').val() == "0") {
$('#<%=comboFacility.ClientID %>').empty().append('<option selected="selected" value="0">Select</option>');
}
else {
$('#<%=comboFacility.ClientID %>').empty().append('<option selected="selected" value="0">Loading...</option>');
var reclocid = $('#<%=comboRecievingLocation.ClientID%>').val()
$("#<%= hdnreclocid.ClientID %>").val(reclocid);
var hval = document.getElementById('<%=hdnreclocid.ClientID %>').value;
$.ajax({
type: "POST",
url: pageUrl + '/PopulateFacility',
data: '{RecLocId: ' + $('#<%=comboRecievingLocation.ClientID%>').val() + '}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function OnCountriesPopulated(response) {
PopulateControl(response.d, $("#<%=comboFacility.ClientID %>"));
},
failure: function (response) {
alert(response.d);
}
});
}
function PopulateControl(list, control) {
if (list.length > 0) {
control.removeAttr("disabled");
control.empty().append('<option selected="selected" value="0">Select</option>');
$.each(list, function () {
control.append($("<option></option>").val(this['Value']).html(this['Text']));
});
}
else {
control.empty().append('<option selected="selected" value="0">Not available<option>');
}
}
</script>
<asp:DropDownList runat="server" ID="comboRecievingLocation" Width="205Px" onchange="PopulateRecLoc()"
CausesValidation="false">
</asp:DropDownList>
Imports System
Imports System.Collections.Generic
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Configuration
Imports System.Data.SqlClient
Imports System.Data
Imports System.Collections
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Collections.Specialized
Imports AjaxControlToolkit
Imports System.Web.SessionState
Public Class BOLSup
Inherits System.Web.UI.Page
Implements IRequiresSessionState
<System.Web.Services.WebMethod()> _
Public Shared Function PopulateFacility(ByVal RecLocId As Integer) As ArrayList
Dim list As ArrayList = New ArrayList
Dim strConnString As String = ConfigurationManager.ConnectionStrings("SurgereConnection").ConnectionString
Dim strQuery As String = "select facility_id,facility_name from Facility where facility_type<>'Consolidation Center' and location_id=@location_id"
Dim con As SqlConnection = New SqlConnection(strConnString)
Dim cmd As SqlCommand = New SqlCommand
cmd.CommandType = CommandType.Text
cmd.Parameters.AddWithValue("@location_id", RecLocId)
cmd.CommandText = strQuery
cmd.Connection = con
con.Open()
Dim sdr As SqlDataReader = cmd.ExecuteReader
While sdr.Read
list.Add(New ListItem(sdr("facility_name").ToString, sdr("facility_id").ToString))
End While
con.Close()
Return list
End Function
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
<script language="javascript" type="text/javascript">
function showWaitPack() {
$get('<%=UpdateProgressPack.ClientID%>').style.display = 'block';
setTimeout("disablePack();", 1000);
}
function disablePack() {
var controls = document.getElementById("<%=pnlUnitLoadDataSheet.ClientID%>").getElementsByTagName("input");
for (var i = 0; i < controls.length; i++)
controls[i].disabled = true;
setTimeout("HideLabelPack();", 6000);
}
function HideLabelPack() {
document.getElementById('<%= UpdateProgressPack.ClientID %>').style.display = "none";
var controls = document.getElementById("<%=pnlUnitLoadDataSheet.ClientID%>").getElementsByTagName("input");
for (var i = 0; i < controls.length; i++)
controls[i].disabled = false;
if (document.getElementById('<%=rdbDirect.ClientID %>').checked == true) {
document.getElementById('<%=rdbCrossDock.ClientID %>').disabled = true;
document.getElementById('<%=rdbCrossDock.ClientID %>').checked = false;
document.getElementById('<%=rdbRepack.ClientID %>').disabled = true;
document.getElementById('<%=rdbRepack.ClientID %>').checked = false;
}
}
</script>
function showWaitPack() {
$get('<%=UpdateProgressPack.ClientID%>').style.display = 'block';
setTimeout("disablePack();", 1000);
}
function disablePack() {
var controls = document.getElementById("<%=pnlUnitLoadDataSheet.ClientID%>").getElementsByTagName("input");
for (var i = 0; i < controls.length; i++)
controls[i].disabled = true;
setTimeout("HideLabelPack();", 6000);
}
function HideLabelPack() {
document.getElementById('<%= UpdateProgressPack.ClientID %>').style.display = "none";
var controls = document.getElementById("<%=pnlUnitLoadDataSheet.ClientID%>").getElementsByTagName("input");
for (var i = 0; i < controls.length; i++)
controls[i].disabled = false;
if (document.getElementById('<%=rdbDirect.ClientID %>').checked == true) {
document.getElementById('<%=rdbCrossDock.ClientID %>').disabled = true;
document.getElementById('<%=rdbCrossDock.ClientID %>').checked = false;
document.getElementById('<%=rdbRepack.ClientID %>').disabled = true;
document.getElementById('<%=rdbRepack.ClientID %>').checked = false;
}
}
</script>
<style type="text/css">
/* HOVER STYLES */
div#question
{
display: none;
position: absolute;
width: 200px;
padding: 10px;
background: Ivory;
color: #000000;
border: 1px solid skyblue;
font-size: 90%;
}
.thumbnail-item
{
/* position relative so that we can use position absolute for the tooltip */
position: relative;
float: left;
margin: 0px 5px;
}
</style>
<script type="text/javascript">
Sys.Application.add_load(function () {
var moveLeft = 2;
var moveDown = 10;
$('a#trigger').hover(function (e) {
$('div#question').show();
}, function () {
$('div#question').hide();
});
$('a#trigger').mousemove(function (e) {
$("div#question").css('top', e.pageY + moveDown).css('left', e.pageX + moveLeft);
});
});
</script>
<asp:Label runat="server" Style="text-align: center" ID="lblReturnRatio" Text="Return Ratio">
</asp:Label>
<a href="#" id="trigger" tabindex="100">
<img alt="help" src="Images/question.jpg" height="13px" width="13px" />
</a>:
<!-- TOOLTIP -->
<div id="question">
<p>
This is the tool tip for Return Ratio and will be replaced by surgere definition.
</p>
</div>
/* HOVER STYLES */
div#question
{
display: none;
position: absolute;
width: 200px;
padding: 10px;
background: Ivory;
color: #000000;
border: 1px solid skyblue;
font-size: 90%;
}
.thumbnail-item
{
/* position relative so that we can use position absolute for the tooltip */
position: relative;
float: left;
margin: 0px 5px;
}
</style>
<script type="text/javascript">
Sys.Application.add_load(function () {
var moveLeft = 2;
var moveDown = 10;
$('a#trigger').hover(function (e) {
$('div#question').show();
}, function () {
$('div#question').hide();
});
$('a#trigger').mousemove(function (e) {
$("div#question").css('top', e.pageY + moveDown).css('left', e.pageX + moveLeft);
});
});
</script>
<asp:Label runat="server" Style="text-align: center" ID="lblReturnRatio" Text="Return Ratio">
</asp:Label>
<a href="#" id="trigger" tabindex="100">
<img alt="help" src="Images/question.jpg" height="13px" width="13px" />
</a>:
<!-- TOOLTIP -->
<div id="question">
<p>
This is the tool tip for Return Ratio and will be replaced by surgere definition.
</p>
</div>
SqlCommand cmd;
cmd = new SqlCommand("insert into IEP values('1',N'" + txtp1.Text + "')", con);
cmd.ExecuteNonQuery();
cmd = new SqlCommand("insert into IEP values('1',N'" + txtp1.Text + "')", con);
cmd.ExecuteNonQuery();
<connectionStrings>
<add name="SLMFConnection" connectionString="Server=174.122.52.131;Database=abcdb;Uid=admindb;Password=abchenry123;" providerName="System.Data.SqlClient"/>
<!--<add name="SLMFConnection" connectionString="Data Source=.;Initial Catalog=ConsultPlus;UID=sa;password=tiger123"/>-->
<!--<add name="SLMFConnection" connectionString="Data Source=.;Initial Catalog=abccms; Integrated Security=True"/>-->
</connectionStrings>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
public SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["SLMFConnection"].ToString());
public string conStr = ConfigurationManager.ConnectionStrings["SLMFConnection"].ToString();
<add name="SLMFConnection" connectionString="Server=174.122.52.131;Database=abcdb;Uid=admindb;Password=abchenry123;" providerName="System.Data.SqlClient"/>
<!--<add name="SLMFConnection" connectionString="Data Source=.;Initial Catalog=ConsultPlus;UID=sa;password=tiger123"/>-->
<!--<add name="SLMFConnection" connectionString="Data Source=.;Initial Catalog=abccms; Integrated Security=True"/>-->
</connectionStrings>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
public SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["SLMFConnection"].ToString());
public string conStr = ConfigurationManager.ConnectionStrings["SLMFConnection"].ToString();
public SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["SLMFConnection"].ToString());
if (con.State == ConnectionState.Closed)
{
con.Open();
}
if (con.State == ConnectionState.Closed)
{
con.Open();
}
public SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["SLMFConnection"].ToString());
public string conStr = ConfigurationManager.ConnectionStrings["SLMFConnection"].ToString();
SqlCommand cmd;
if (con.State == ConnectionState.Closed)
{
con.Open();
}
cmd = new SqlCommand("select * from IEP", con);
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
txtp1.Text = dr[1].ToString();
}
dr.Close();
con.Close();
public SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["SLMFConnection"].ToString());
public string conStr = ConfigurationManager.ConnectionStrings["SLMFConnection"].ToString();
SqlCommand cmd;
try
{
if (con.State == ConnectionState.Closed)
{
con.Open();
}
cmd = new SqlCommand("select * from [inner] where country='"+ddcountry.SelectedValue+"' and page='"+ddname.SelectedValue+"'", con);
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
dr.Close();
cmd = new SqlCommand("update [inner] set lblp1=@lblp1 where country=@country and page=@page", con);
cmd.Parameters.Add("@page", SqlDbType.VarChar, 50).Value = ddname.SelectedValue;
cmd.Parameters.Add("@lblp1", SqlDbType.NText).Value = CKEditor1.Text;
cmd.Parameters.Add("@country", SqlDbType.VarChar, 5000).Value = ddcountry.SelectedValue;
//cmd = new SqlCommand("update [inner] set lblp1=N'"+CKEditor1.Text+"' where country='"+ddcountry.SelectedValue+"' and page='"+ddname.SelectedValue+"'", con);
cmd.ExecuteNonQuery();
}
else
{
dr.Close();
cmd = new SqlCommand("insert into [inner] values(@country,@page,@lblp1)", con);
cmd.Parameters.Add("@page", SqlDbType.VarChar, 50).Value = ddname.SelectedValue;
cmd.Parameters.Add("@lblp1", SqlDbType.NText).Value = CKEditor1.Text;
cmd.Parameters.Add("@country", SqlDbType.VarChar, 5000).Value = ddcountry.SelectedValue;
//cmd = new SqlCommand("insert into [inner] values('"+ddcountry.SelectedValue+"','"+ddname.SelectedValue+"',N'"+CKEditor1.Text+"')", con);
cmd.ExecuteNonQuery();
}
con.Close();
clsAlert.Show("Data Saved Successfully");
CKEditor1.ReadOnly = true;
}
catch (Exception ex)
{
}
public string conStr = ConfigurationManager.ConnectionStrings["SLMFConnection"].ToString();
SqlCommand cmd;
try
{
if (con.State == ConnectionState.Closed)
{
con.Open();
}
cmd = new SqlCommand("select * from [inner] where country='"+ddcountry.SelectedValue+"' and page='"+ddname.SelectedValue+"'", con);
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
dr.Close();
cmd = new SqlCommand("update [inner] set lblp1=@lblp1 where country=@country and page=@page", con);
cmd.Parameters.Add("@page", SqlDbType.VarChar, 50).Value = ddname.SelectedValue;
cmd.Parameters.Add("@lblp1", SqlDbType.NText).Value = CKEditor1.Text;
cmd.Parameters.Add("@country", SqlDbType.VarChar, 5000).Value = ddcountry.SelectedValue;
//cmd = new SqlCommand("update [inner] set lblp1=N'"+CKEditor1.Text+"' where country='"+ddcountry.SelectedValue+"' and page='"+ddname.SelectedValue+"'", con);
cmd.ExecuteNonQuery();
}
else
{
dr.Close();
cmd = new SqlCommand("insert into [inner] values(@country,@page,@lblp1)", con);
cmd.Parameters.Add("@page", SqlDbType.VarChar, 50).Value = ddname.SelectedValue;
cmd.Parameters.Add("@lblp1", SqlDbType.NText).Value = CKEditor1.Text;
cmd.Parameters.Add("@country", SqlDbType.VarChar, 5000).Value = ddcountry.SelectedValue;
//cmd = new SqlCommand("insert into [inner] values('"+ddcountry.SelectedValue+"','"+ddname.SelectedValue+"',N'"+CKEditor1.Text+"')", con);
cmd.ExecuteNonQuery();
}
con.Close();
clsAlert.Show("Data Saved Successfully");
CKEditor1.ReadOnly = true;
}
catch (Exception ex)
{
}
<%@ Register Src="USRSupplierDetails.ascx" TagName="USRSupplierDetails" TagPrefix="uc1" %>
<uc1:usrsupplierdetails id="USRSupplierDetails1" runat="server" />
<script type="text/javascript" language="javascript">
function getfacid() {
var facid = $('#<%=ddl_facility.ClientID%>').val()
$("#<%= hdnfacid.ClientID %>").val(facid);
var hval = document.getElementById('<%=hdnfacid.ClientID %>').value;
}
</script>
<input id="hdnfacid" runat="server" type="hidden" />
<asp:DropDownList runat="server" ID="ddl_facility" Width="170px" onchange="getfacid()">
</asp:DropDownList>
function getfacid() {
var facid = $('#<%=ddl_facility.ClientID%>').val()
$("#<%= hdnfacid.ClientID %>").val(facid);
var hval = document.getElementById('<%=hdnfacid.ClientID %>').value;
}
</script>
<input id="hdnfacid" runat="server" type="hidden" />
<asp:DropDownList runat="server" ID="ddl_facility" Width="170px" onchange="getfacid()">
</asp:DropDownList>