http://www.hbzypx.cn/msg/?id=3944745&member_id=704838
点击
“订单” 或 “留言”按钮
然后发送,发送后怎么叫那个页面消失,数据写入sql,并且提示发送成功!
呵呵
各位大虾有没有好的例子。
谢谢!
点击
“订单” 或 “留言”按钮
然后发送,发送后怎么叫那个页面消失,数据写入sql,并且提示发送成功!
呵呵
各位大虾有没有好的例子。
谢谢!
解决方案 »
- 添加现有项目以后写的新方法在UI层不能调用
- 2008使用的是2000的默认实例MSSQLSERVER。这样就会导致2008的一些功能使用报错
- 请问如何将GridView1中的数据通过点击Button1导出到excel中,谢谢!
- 无页面刷新!
- 我把一个信息发给很多人,很多人这个数据在数据库里最好用什么方式保存?
- [求助]因为要做一个会员系统,所以想用“二叉树”思想实现,可实在无从下手,请高手赐教
- 新手学习ASP.NET的疑问?
- 如何用asp.net获取这些cookie信息?
- 关于log4net 性能问题
- 求助:客户端操作服务器注册表并运行服务器端应用程序的问题。。。
- sql 语句
- WebService处理问题
M_email=document.getElementById("M_UserEmail").value;
M_phone=document.getElementById("M_UserPhone").value;
M_count=document.getElementById("M_UserCount").value;怎么才能写到数据库呢?
找下相关资料,看完你就差不多知道怎么做了
应该和那出不多!!
iframe+html都在js里写!!
ClientScript.RegisterStartupScript(page.GetType(), null, "alert('保存成功!'); (div的id).style.visibility=hide; ", true);
M_name=document.getElementById("M_UserName").value;
M_name存到数据库里面去?
在是html代码:
<td width="10%" bgcolor="#F0F0F0" class="kehu_lianjie2"><a href="#"onclick="window.open('moreProgress.aspx','','width=600,height=450');">查看更多>></a><br /><a href="#"onclick="window.open('addProgress.aspx','','width=400,height=250');">添加新进度>></a></td>
接下来是cs代码:
protected void Button1_Click(object sender, EventArgs e)
{
progress p = new progress();
progress_bll pb = new progress_bll();
p.CreateDate = DateTime.Now;
p.CustomerName = Session["CName"].ToString();
p.PContent = this.TxtContent.Text.ToString();
pb.insert_Update_Progress(p,0);
Response.Write("<script language=javascript>alert('添加成功!');opener.location.reload();window.close();</script>");
}
其实也可以用服务器控件,把服务器控件放在div里,div_订单在按钮点击时出发显示,从服务器控件中读取数据存入数据库应该会吧?存完数据后,直接用response.write写出js让div_订单消失。如果要表单是客户端控件的话,建议用ajax,在.net里用ajax很简单的,在页面里拖入一个ajax scriptmanager然后如下设置
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="LSoaService.asmx" />
</Services>
</asp:ScriptManager>
通过webservices来连接后台方法,比如下面的例子:
<script language=javascript>
function sortfile(fileid)
{
ret=LSoaService.sortfile(fileid,OnComS);
}
function OnComS(str)
{
alert("归档成功!");
}
</script>LSoaService.cs里对应代码是
[WebMethod]
public string sortfile(string str)
{
int fileid = Int32.Parse(str);
LSFile lf = new LSFile();
lf.doctofile(fileid);
return "a";
}其中lsfile是处理文件的类,doctofile是数据层的方法。如果出入的参数比较多,可以在客户端通过$或者|等特殊字符连接各参数然后在服务器端再用split分开,我觉得这样挺好用的。