开发者

How to open another form in codebehind using javascript

I have following code in button click Response.Write("window.open('Contact.aspx')");

The above code is working.but if use

String s = "Contact.aspx";
            R开发者_StackOverflowesponse.Write("<script type=text/javascript>window.open('"+s+"')</script>");

The above code shows error as 'Too many literals'.Can anybody help to remove this error.


I believe you're missing the enclosing quotes around "text/javascript".

It should be:

String s = "Contact.aspx";
            Response.Write("<script type='text/javascript'>window.open('"+s+"')</script>");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜