<script type="text/javascript">
function test(a)
{
window.opener.document.forms[0].elements['src'].value = a;
}
</script>
protected void btnUpload_Click(object sender, EventArgs e)
{
try
{
string filename = Path.GetFileName(this.fileuploadimages.PostedFile.FileName);
fileuploadimages.SaveAs(Server.MapPath("~/Images/" + filename));
ImageUrl = "~/Images/" + filename;
btnUpload.OnClientClick = string.Format("test(\'{0}\');",ImageUrl);
Response.Write("<script language="'javascript'"> {top.close() }</script>");
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
}
我需要使用参数调用名为 test 的 javascript 函数
我正在尝试像上面那样,但它不起作用请提前帮助我thanx