开发者

Click on button to pop-up new window with passing URL in .net c# web application

I'm new in .net C#, just a question here. how can I click a button then it will pop-up a new window to display a page?

example: If I have a page test.aspx, how can I code in .net c# web application so开发者_如何学运维 that it will pop-up a new window to display this page?


There's nothing intrinsic with ASP.NET or C# that does this. You're still outputting Html, so the methods of doing such a thing in JavaScript or target="_blank" in a link will still work.


You can call window.open("test.aspx"); in Javascript.


If you want a nice looking solution, you can use a JavaScript implemenation called ColorBox http://colorpowered.com/colorbox/

You would render that second page as an Iframe inside a dialog / popup. See this example page http://colorpowered.com/colorbox/core/example5/index.html: Other Content Types -> Outside Webpage (Iframe)


ASP.NET HyperLink Control is another way. You have access to it's properties on code-behind if you need to manipulate the Url programmatically.


if you use Open a new Window then it will opens in new window.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜