我有一个网页,我从中生成一个带有响应对象的弹出窗口,以创建/下载 vcard。它按预期运行,但是我的父页面上的字体大小变得很大,并且只有在我刷新页面时才会恢复到原来的大小。我该如何解决?
我对 vcard 弹出窗口的调用:
Response.Write(@"<script language = 'Javascript'>var" +
@" win=window.open('vCard.aspx',null,'width=50,height=50," +
@"top=100,left=100','true');</script>");
电子名片制作:
public static void VCard(HttpResponse response)
{
response.Clear();
response.Charset = "";
response.ContentType = "text/x-vCard";
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
{
response.AddHeader("content-disposition", "attachment; filename=" + usr.SamAccountName);
stringWrite.WriteLine("BEGIN:VCARD");
stringWrite.WriteLine("VERSION:2.1");
//Name
stringWrite.WriteLine("N:" + usr.LastName + ";" + usr.FirstName
);
//removed other vcard lines....
//vCard End
stringWrite.WriteLine("END:VCARD");
response.Write(stringWrite.ToString());
response.End();
}
}