从一个页面跳转到另一个页面的指定位置(带平滑移动的效果)
Page1:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="page1.aspx.cs" Inherits="WebTestDelegateEvent.page1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<a href="page2.aspx?mao=s">跳转</a>
</div>
</form>
</body>
</html>
Page2:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="page2.aspx.cs" Inherits="WebTestDelegateEvent.page2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
<script type="text/javascript" src="js/jquery.js">
</script>
<script type="text/javascript">
//根据参数名获得该参数 pname等于想要的参数名
function getParam(pname) {
var params = location.search.substr(1); // 获取参数 平且去掉?
//alert(params);
var ArrParam = params.split('&'); if (ArrParam.length == 1) {
//只有一个参数的情况
return params.split('=')[1]; }
else { //多个参数参数的情况
for (var i = 0; i < ArrParam.length; i++) {
if (ArrParam[i].split('=')[0] == pname) {
return ArrParam[i].split('=')[1]; } } } }
$(function() { var mao = $("#" + getParam("s")); //获得锚点
if (mao.length > 0) {//判断对象是否存在
var pos = mao.offset().top;
var poshigh = mao.height();
$("html,body").animate({ scrollTop: pos-poshigh-30}, 3000); } });
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
this.pgCustomerProperties.Item.Add("5.01. " + Properties.Resources.Name_BusinessType, this.m_eCust.DetCode, false, strInvoiceInfoCat, this.m_eCust.DetCode, true);
this.pgCustomerProperties.Item.Add("5.02. " + Properties.Resources.Name_PriceListNo, this.m_eCust.PriceListNo, false, strInvoiceInfoCat, this.m_eCust.PriceListNo, true);
this.pgCustomerProperties.Item.Add("5.03. " + Properties.Resources.Name_InvoicePrintCode, this.m_eCust.InvoicePrintCode, false, strInvoiceInfoCat, this.m_eCust.InvoicePrintCode, true);
this.pgCustomerProperties.Item.Add("5.04. " + Properties.Resources.Name_BankName, this.m_eCust.BankName, false, strInvoiceInfoCat, this.m_eCust.BankName, true);
//this.pgCustomerProperties.Item.Add("5.05. " + Properties.Resources.Name_TaxRegCode, this.m_eCust.TaxRegCode, false, strInvoiceInfoCat, this.m_eCust.TaxRegCode, true);
this.pgCustomerProperties.Item.Add("5.05. " + Properties.Resources.Name_BankAccount, this.m_eCust.BankAccount, false, strInvoiceInfoCat, this.m_eCust.BankAccount, true);
//this.pgCustomerProperties.Item.Add("5.07. " + Properties.Resources.Name_EnterprisePhone, this.m_eCust.EnterprisePhone, false, strInvoiceInfoCat, this.m_eCust.EnterprisePhone, true);
//this.pgCustomerProperties.Item.Add("5.08. " + Properties.Resources.Name_EnterpriseAddress, this.m_eCust.EnterpriseAddress, false, strInvoiceInfoCat, this.m_eCust.EnterpriseAddress, true);
//this.pgCustomerProperties.Item.Add("5.09. " + Properties.Resources.Name_EnterpriseName, this.m_eCust.EnterpriseName, false, strInvoiceInfoCat, this.m_eCust.EnterpriseName, true);
//this.pgCustomerProperties.Item.Add("5.10. " + Properties.Resources.Name_EnterpriseCode, this.m_eCust.EnterpriseCode, false, strInvoiceInfoCat, this.m_eCust.EnterpriseCode, true);
string strDeliveryInfoCat = "6. " + Properties.Resources.Category_DeliveryInfo;
this.pgCustomerProperties.Item.Add("6.01. " + Properties.Resources.Name_DeliveryAddress, this.m_eCust.DeliveryAddressE, false, strDeliveryInfoCat, this.m_eCust.DeliveryAddressE, true);
this.pgCustomerProperties.Item.Add("6.02. " + Properties.Resources.Name_PostalCode, this.m_eCust.PostalCode, false, strDeliveryInfoCat, this.m_eCust.PostalCode, true);
this.pgCustomerProperties.Item.Add("6.03. " + Properties.Resources.Name_ProvinceCode, this.m_eCust.ProvinceCode, false, strDeliveryInfoCat, this.m_eCust.ProvinceCode, true);
this.pgCustomerProperties.Item.Add("6.04. " + Properties.Resources.Name_CityCode, this.m_eCust.CityCode, false, strDeliveryInfoCat, this.m_eCust.CityCode, true);
//this.pgCustomerProperties.Item.Add("6.05. " + Properties.Resources.Name_DeliveryRoute, this.m_eCust.DeliveryRoute, false, strDeliveryInfoCat, this.m_eCust.DeliveryRoute, true);
this.pgCustomerProperties.Item.Add("6.05. " + Properties.Resources.Name_PartnerOutletNo, this.m_eCust.PartnerOutletNo, false, strDeliveryInfoCat, this.m_eCust.PartnerOutletNo, true);
this.pgCustomerProperties.Item.Add("6.06. " + Properties.Resources.Name_BusinessType, this.m_eCust.BusinessTypeCode, false, strDeliveryInfoCat, this.m_eCust.BusinessTypeCode, true);
this.pgCustomerProperties.Item.Add("6.07. " + Properties.Resources.Name_DelLocationCode, this.m_eCust.DelLocationCode, false, strDeliveryInfoCat, this.m_eCust.DelLocationCode, true);
this.pgCustomerProperties.Item.Add("6.08. " + Properties.Resources.Name_RoadshowCustomer, this.m_eCust.RoadshowInd, false, strDeliveryInfoCat, this.m_eCust.RoadshowInd, true);
this.pgCustomerProperties.Item.Add("6.09. " + Properties.Resources.Name_DeliveryMethod, this.m_eCust.DeliveryMethod, false, strDeliveryInfoCat, this.m_eCust.DeliveryMethod, true);
this.pgCustomerProperties.Item.Add("6.10. " + Properties.Resources.Name_Consignee, this.m_eCust.Consignee, false, strDeliveryInfoCat, this.m_eCust.Consignee, true);
this.pgCustomerProperties.Item.Add("6.11. " + Properties.Resources.Name_StorageSpace, this.m_eCust.StorageSpaceCode, false, strDeliveryInfoCat, this.m_eCust.StorageSpaceCode, true);
this.pgCustomerProperties.Item.Add("6.12. " + Properties.Resources.Name_TruckLimit, this.m_eCust.TruckLimitCode, false, strDeliveryInfoCat, this.m_eCust.TruckLimitCode, true);
this.pgCustomerProperties.Item.Add("6.13. " + Properties.Resources.Name_DocPrintCode, this.m_eCust.DocPrintCode, false, strDeliveryInfoCat, this.m_eCust.DocPrintCode, true);
this.pgCustomerProperties.Item.Add("6.14. " + Properties.Resources.Name_DriverMessage, this.m_eCust.DriverMessage, false, strDeliveryInfoCat, this.m_eCust.DriverMessage, true);
//
//2010/9/19,begin,sunwj
string strStaffCategory = "7. " + Properties.Resources.Category_Staff;
this.pgCustomerProperties.Item.Add("7.01. " + Properties.Resources.Name_StaffName, e.Data.OutlerStaff.Name, false, strStaffCategory, "", true);
this.pgCustomerProperties.Item.Add("7.02. " + Properties.Resources.Name_StaffPhone, e.Data.OutlerStaff.Phone, false, strStaffCategory, "", true);
string strPartnerCategory = "8. " + Properties.Resources.Category_Partner;
this.pgCustomerProperties.Item.Add("8.01. " + Properties.Resources.Name_PartnerOutletNo, e.Data.OutletPartner.OutletNo, false, strPartnerCategory, "", true);
this.pgCustomerProperties.Item.Add("8.02. " + Properties.Resources.Name_PartnerName, e.Data.OutletPartner.Name, false, strPartnerCategory, "", true);
this.pgCustomerProperties.Item.Add("8.03. " + Properties.Resources.Name_PartnerContact, e.Data.OutletPartner.Contact, false, strPartnerCategory, "", true);
this.pgCustomerProperties.Item.Add("8.04. " + Properties.Resources.Name_PartnerPhone + "#1", e.Data.OutletPartner.Phone1, false, strPartnerCategory, "", true);
this.pgCustomerProperties.Item.Add("8.05. " + Properties.Resources.Name_PartnerPhone + "#2", e.Data.OutletPartner.Phone2, false, strPartnerCategory, "", true);
this.pgCustomerProperties.Item.Add("8.06. " + Properties.Resources.Name_PartnerAddress, e.Data.OutletPartner.Address, false, strPartnerCategory, "", true);
this.ExpandedGrid();
//2010/9/19,end,sunwj
//
this.pgCustomerProperties.Refresh();
#region Sync. Invoke
//this.CallListActivityAssociationBindingSource.DataSource = GetCallListActivityAssociationByOutletNo(long.Parse(this.m_eCust.OutletNo));
//this.cboActivity.Enabled = (this.CallListActivityAssociationBindingSource.Count > 0);
//this.ucmdStart.Enabled = (this.CallListActivityAssociationBindingSource.Count > 0);
// GetCallListActivityAssociationByOutletNo(long.Parse(this.m_eCust.OutletNo));
this.FillActivityAssociation();
lock (this)
{
this.CallListActivityAssociationBindingSource.DataSource = null;
this.cboActivity.Enabled = false;
this.ucmdStart.Enabled = false;
}
#endregion
}
catch (Exception ex)
{
// throw;
// swj add log 2008-1-31
SBCRMCommon.Helper.CommonHelper.LogWrite(this, ex.Message);
}
finally
{
</div>
<div id="s">
/this.pgCustomerProperties.Item.Add("6.05. " + Properties.Resources.Name_DeliveryRoute, this.m_eCust.DeliveryRoute, false, strDeliveryInfoCat, this.m_eCust.DeliveryRoute, true);
this.pgCustomerProperties.Item.Add("6.05. " + Properties.Resources.Name_PartnerOutletNo, this.m_eCust.PartnerOutletNo, false, strDeliveryInfoCat, this.m_eCust.PartnerOutletNo, true);
this.pgCustomerProperties.Item.Add("6.06. " + Properties.Resources.Name_BusinessType, this.m_eCust.BusinessTypeCode, false, strDeliveryInfoCat, this.m_eCust.BusinessTypeCode, true);
this.pgCustomerProperties.Item.Add("6.07. " + Properties.Resources.Name_DelLocationCode, this.m_eCust.DelLocationCode, false, strDeliveryInfoCat, this.m_eCust.DelLocationCode, true);
this.pgCustomerProperties.Item.Add("6.08. " + Properties.Resources.Name_RoadshowCustomer, this.m_eCust.RoadshowInd, false, strDeliveryInfoCat, this.m_eCust.RoadshowInd, true);
this.pgCustomerProperties.Item.Add("6.09. " + Properties.Resources.Name_DeliveryMethod, this.m_eCust.DeliveryMethod, false, strDeliveryInfoCat, this.m_eCust.DeliveryMethod, true);
this.pgCustomerProperties.Item.Add("6.10. " + Properties.Resources.Name_Consignee, this.m_eCust.Consignee, false, strDeliveryInfoCat, this.m_eCust.Consignee, true);
this.pgCustomerProperties.Item.Add("6.11. " + Properties.Resources.Name_StorageSpace, this.m_eCust.StorageSpaceCode, false, strDeliveryInfoCat, this.m_eCust.StorageSpaceCode, true);
this.pgCustomerProperties.Item.Add("6.12. " + Properties.Resources.Name_TruckLimit, this.m_eCust.TruckLimitCode, false, strDeliveryInfoCat, this.m_eCust.TruckLimitCode, true);
this.pgCustomerProperties.Item.Add("6.13. " + Properties.Resources.Name_DocPrintCode, this.m_eCust.DocPrintCode, false, strDeliveryInfoCat, this.m_eCust.DocPrintCode, true);
this.pgCustomerProperties.Item.Add("6.14. " + Properties.Resources.Name_
</div>
</form>
</body>
</html>
浙公网安备 33010602011771号