获取后台的数据,前台显示出!

zycgps zycgps 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
就是有个表单,提交后后台应该产生一个随机的数,写入数据库,然后会弹出另外一个页面...(另外一个页面不管)!!
在想可以用什么办法在提交后,就在X1.ASPX 提交的表单当前页弹出一个层,显示出后台是写入的什么字段到数据库!!

CreateOkxrOrderId

OkxrOrderId 这个就是数据库的字段...OkxrOrderId

X1.CS
namespace PayCenter.PayMent
{
public partial class _70bank : System.Web.UI.Page
{
protected string bili;
protected string gamebz;
protected string mdname;
protected string zeng;
protected string _js = string.Empty;

protected void Page_Load(object sender, EventArgs e)
{
if (!base.IsPostBack)
{
if (SafeCookie.GetCookie("sid") != null)
{
MirDivisionInfo mDbyid = MirDivisionFactory.GetMDbyid(int.Parse(SafeCookie.GetCookie("sid")));
bili = mDbyid.MD_Bili.ToString();
if (mDbyid.MD_BZ == "")
{
gamebz = "元宝";
}
else
{
gamebz = mDbyid.MD_BZ;
}
mdname = mDbyid.MD_Name;
if (mDbyid.MD_onPay == 1)
{

foreach (string str in mDbyid.MD_NewPay.Split(new char[] { '|' }))
{
if (str.Split(',')[0] == "102")
{
string str2 = _js;
_js = str2 + "$(\"paystring\").innerHTML=\"<table border='0' cellpadding='1' cellspacing='1' bgcolor='#999' width='100%' ><tbody align='center' bgcolor='#F9FAFC'><tr><td>不足50</td><td>满50元</td><td>满100元</td><td>满200元</td><td>满300元</td><td>满500元</td><td>满1000元</td><td>满2000元</td></tr><td class='fc'>1:" + str.Split(',')[1].ToString() + "%</td><td class='fc'>1:" + str.Split(',')[2].ToString() + "%</td><td class='fc'>1:" + str.Split(',')[3].ToString() + "%</td><td class='fc'>1:" + str.Split(',')[4].ToString() + "%</td><td class='fc'>1:" + str.Split(',')[5].ToString() + "%</td><td class='fc'>1:" + str.Split(',')[6].ToString() + "%</td><td class='fc'>1:" + str.Split(',')[7].ToString() + "%</td><td class='fc'>1:" + str.Split(',')[8].ToString() + "%</td></tr></tbody></table>\";";
}

}

}
else
{
pay1.Style.Add("display", "none");
foreach (string str in mDbyid.MD_Pay.Split(new char[] { '|' }))
{
int result = 0;
int.TryParse(str.Split(new char[] { ',' })[0], out result);
if (result == 102)
{
zeng = str.Split(new char[] { ',' })[2].ToString();
}
}
}
}
else
{
base.Response.Write("<script>alert('请重新操作');</script>");
}
}

}

protected void paybtnok_Click(object sender, EventArgs e)
{
decimal num = 0M;
try
{
num = decimal.Parse(paymoney.Text.Trim());
if (num < 0M)
{
errLabel.Text = "充值金额必须大于等于0";
return;
}
}
catch
{
num = 100M;
}
int num2 = 102;
string str = txtusername.Text.Trim();
if (num2 == 102)
{
string url = string.Empty;
PayMentFactory.PayType type = (PayMentFactory.PayType)num2;
ulong num3 = PayMentFactory.CreateOkxrOrderId(type);
string contactor = txtQQ.Text.Trim();
if (PayMentFactory.InitOrder(int.Parse(SafeCookie.GetCookie("sid")), str, int.Parse(SafeCookie.GetCookie("gmid")), type, num3, "0", num,contactor))
{
url = new Cared70().PayBank(num3.ToString(), num.ToString(), BankBox.Value);
base.Response.Redirect(url);
}
else
{
errLabel.Text = "充值失败";
}
}
}
}
}


X1.ASPX
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="x1.aspx.cs" Inherits="x1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head id="Head1" runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
</head>

<body>
<form id="form1" runat="server" target="_blank">
<div class="warp">
<div class="header">
<div class="login_nav" id="login_nav">
</div><!--end login_nav-->
</div><!--end header-->
<div class="nav">
<ul>
<li><a href="#" class="on"><span><%=mdname %></span></a></li>
<li style="float:right; margin-right:10px; font-family: Georgia, 'Times New Roman', Times, serif; line-height:25px; color:#060"><span><uc1:QuestionRight ID="QuestionRight1" runat="server" /></span></li>
</ul>
</div><!--end nav--><!--end h7--><!--end bdr--><!--end that--><!--end footer-->
</div>
<div class="wrap">
<div style="margin-top:4px;"><span class="STYLE1"><img src="/images612/laba.gif" alt="" width="16" height="16" /> <asp:HiddenField ID="PayType" runat="server" Value="102"/>当前您选择<%=mdname %></span>
<span>兑换比列:<span style="COLOR:blue"><b><%=bili %></b><%=gamebz %> </span></span></span></div>

<DIV class="hotpay" style=" width:901px; background-image:url(/images612/hotpay1.jpg);background-repeat: no-repeat;overflow:hidden">
<DIV class="pay2" style="width:810px; margin-left:15px; margin-top:10px">

<fieldset><legend><span style="background: #339933; border: 2px dashed #060;text-align:center;padding:1px;"><font color="#FFFFFF"><b>网上银行充值</b></font></span></legend>
<div style="padding:1px">
<div id="pay1" runat="server"><br/>
<div id="paystring"></div>
</div><br/>
<div style="padding:1px">
<p class="giveinfo"><label for="svcno">输入账号:</label> <asp:TextBox ID="txtusername" runat="server" CssClass="shuru" ></asp:TextBox> <span style="color:Red">* 请认真核对.</span></p>
<p class="giveinfo"><label for="svcno2">确定账号:</label> <asp:TextBox ID="txtusername2" runat="server" CssClass="shuru"></asp:TextBox> <span style="color:Red">* 请认真核对.</span></p>
<p class="giveinfo"><label for="svcno2">手机/QQ:</label> <asp:TextBox ID="txtQQ" runat="server" CssClass="shuru" onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"></asp:TextBox> <span style="color:Red">* 请认真核对.</span></p>
<p class="giveinfo"><label for="svcno2">金币:</label>
<asp:TextBox ID="paymoney" runat="server" style="width:55px" CssClass="shuru"></asp:TextBox> <asp:Label ID="errLabel" runat="server" Text="* 请输入您本次充值的金币.单位/元" ForeColor="#FF8000"></asp:Label></p></div></br>
<div id="ygk">
<div>
<asp:HiddenField ID="BankBox" runat="server" Value="1002" />
<div class="banklist">
<p><input type="radio" name="Pd_FrpId" onclick="SetBank(this.value)" value="1002" id="gsyh"/><label for="gsyh" class="gsyh"></label></p>
<p><input type="radio" name="Pd_FrpId" onclick="SetBank(this.value)" value="1005" id="nyyh"/><label for="nyyh" class="nyyh"></label></p>
<p><input type="radio" name="Pd_FrpId" onclick="SetBank(this.value)" value="1001" id="zsyh" /><label for="zsyh" class="zsyh"></label></p>
<p><input type="radio" name="Pd_FrpId" onclick="SetBank(this.value)" value="1003" id="jsyh"/><label for="jsyh" class="jsyh"></label></p></div>
</div></div></div>
</fieldset>

<br>
<p align="center">
<asp:Button ID="paybtnok" runat="server" Text="∴确定∴" class="qdcc2" OnClick="paybtnok_Click" OnClientClick="return f_login();"/>
</p>
</DIV><br>
<uc2:Footer ID="Footer1" runat="server" />
</DIV>

</DIV>
</div>
</div>
<script type="text/javascript"><%=_js %></script>

</form>
</body>
</html>
...全文

相关推荐

评论 17
收藏 已收藏
分享
返回顶部
zycgps
.NET社区 62,272 成员 668,968 内容