如何在FormView的Edit模板和Insert模板中实现,TextBox双击弹出一个窗体.然后双击窗体的值返回到FormView的TextBox中. 请教高手....如何在FormView的Edit模板和Insert模板中实现,TextBox双击弹出一个窗体.然后双击窗体的值返回到FormView的TextBox中.最主要我不清楚,如何在模板中添加脚本.... 如果放在页面的title中.根本就调用不了.谢谢了. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <head runat="server"> <title>无标题页</title> <script language="javascript" type="text/javascript"> function showWin(objTxt) { var newWin = window.showModalDialog("smallWin.aspx"); if(newWin != null) { objTxt.value = newWin; } } </script></head><body> <form id="form1" runat="server"> <div> <asp:FormView ID="FormView1" runat="server" AllowPaging="True" DataKeyNames="CityID" DataSourceID="AccessDataSource1" DefaultMode="Edit" OnItemCreated="FormView1_ItemCreated" OnDataBound="FormView1_DataBound"> <EditItemTemplate> CityID: <asp:Label ID="CityIDLabel1" runat="server" Text='<%# Eval("CityID") %>'></asp:Label><br /> City: <asp:TextBox ID="CityTextBox" runat="server" Text='<%# Bind("City") %>' ondblclick="showWin(this);"> </asp:TextBox>.... <%@ Page Language="C#" AutoEventWireup="true" CodeFile="smallWin.aspx.cs" Inherits="smallWin" %><!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> <base target="_self" /></head><body> <form id="form1" runat="server"> <div> <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /></div> </form></body></html>================================protected void Button1_Click(object sender, EventArgs e) { string tmp = DateTime.Now.ToString();//需要回传到父页面的值 Page.ClientScript.RegisterStartupScript(typeof(string), "close", "<script>this.returnValue='"+tmp+"';window.close();</script>"); } 简单JQUERY移动问题 Lucene.net 要实现文本数字和范围的搜索要怎么写代码? 如何把asp.net文章列表成生静态页面,并且分页 关于GridView通过CheckBox选中行的问题 一个全局变量的问题! 学习ASP.NET 需要准备些什么? HttpContext的细节问题比较难 100分,加载RealPlayer,进来瞧瞧吧!~~~ 小问题,关于客户端脚本的,送分!! 哪儿有。net的免费或收费不高的空间?? 在搜索时多查询几次速度就很慢了,不知是什么引起的 DropDownList及TextBox控件问题
<title>无标题页</title>
<script language="javascript" type="text/javascript">
function showWin(objTxt)
{
var newWin = window.showModalDialog("smallWin.aspx");
if(newWin != null)
{
objTxt.value = newWin;
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:FormView ID="FormView1" runat="server" AllowPaging="True" DataKeyNames="CityID"
DataSourceID="AccessDataSource1" DefaultMode="Edit" OnItemCreated="FormView1_ItemCreated" OnDataBound="FormView1_DataBound">
<EditItemTemplate>
CityID:
<asp:Label ID="CityIDLabel1" runat="server" Text='<%# Eval("CityID") %>'></asp:Label><br />
City:
<asp:TextBox ID="CityTextBox" runat="server" Text='<%# Bind("City") %>' ondblclick="showWin(this);">
</asp:TextBox>....
<head runat="server">
<title>无标题页</title>
<base target="_self" />
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /></div>
</form>
</body>
</html>
================================
protected void Button1_Click(object sender, EventArgs e)
{
string tmp = DateTime.Now.ToString();//需要回传到父页面的值
Page.ClientScript.RegisterStartupScript(typeof(string), "close", "<script>this.returnValue='"+tmp+"';window.close();</script>");
}