
在Asp.net中怎么弹出提示框,并能够得到提示框的返回值??
在转到另一个页面时,如果数据库没有数据的话弹出一个提示框,如果用户点确定了,抓到主页,否则转到错误页面!该怎么写那个提示框,并能够判断提示框返回的值??谢谢各位了!!急用...
在转到另一个页面时,如果数据库没有数据的话弹出一个提示框,如果用户点确定了,抓到主页,否则转到错误页面!该怎么写那个提示框,并能够判断提示框返回的值??谢谢各位了!!急用!!!!
展开
2013-07-30
展开全部
网上抓来的 不知道是不是你想要的 a.aspx中的文件简略内容
<asp:imagebutton id="cortrol_property_ImageButton" runat="server" ImageUrl="pic/cortrol_property.gif" ToolTip="更改名称"></asp:imagebutton>
<!--下面的就是把javascript的值传到下面的文本框中,然后在服务器端取值-->
<INPUT id="filename" type="text" name="filename_1"></td>a.aspx.cs中的文件简略内容[newfile是html元素中文本框的值]protected string newfile;
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
filepath=Server.MapPath("htmledit");
if(!Page.IsPostBack)
{
cortrol_property_ImageButton.Attributes["onclick"]="javascript: var x = prompt(\"请输入你要\"修改\"的文件夹名称\");if(x==null||x==\"undefined\"||x==\"\"||x==false){alert(\"您没有输入文件夹名称,不能修改!!\");return false;}else{document.all.item(\"filename\").value=x;}";
}
if (this.Page.IsPostBack)
{
newfile = Request.Params["filename_1"];
}
}
<asp:imagebutton id="cortrol_property_ImageButton" runat="server" ImageUrl="pic/cortrol_property.gif" ToolTip="更改名称"></asp:imagebutton>
<!--下面的就是把javascript的值传到下面的文本框中,然后在服务器端取值-->
<INPUT id="filename" type="text" name="filename_1"></td>a.aspx.cs中的文件简略内容[newfile是html元素中文本框的值]protected string newfile;
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
filepath=Server.MapPath("htmledit");
if(!Page.IsPostBack)
{
cortrol_property_ImageButton.Attributes["onclick"]="javascript: var x = prompt(\"请输入你要\"修改\"的文件夹名称\");if(x==null||x==\"undefined\"||x==\"\"||x==false){alert(\"您没有输入文件夹名称,不能修改!!\");return false;}else{document.all.item(\"filename\").value=x;}";
}
if (this.Page.IsPostBack)
{
newfile = Request.Params["filename_1"];
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-07-30
展开全部
这是很麻烦的,不好做的!你还是上网上搜Response。Write()对网页的影响吧!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询