Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Friday, 25 March 2016

HOW TO OPEN WEBFORM IN NEW TAB OR WINDOW IN ASP.NET C#


Today in Engineer's World, we are discussing ASP.NET & C# query faced by a developer in very easy way. Posted By- +Manish Kumar Gautam +LIVE VIAR +ASP.NET SOLUTIONS 

Click imagination hunt to see latest Blogs


HOW TO OPEN WEBFORM IN NEW TAB OR WINDOW IN ASP.NET

Page navigation is a way by which we navigate a user from one webform to another webform.

There are two values by which we can target to open a webform in a different tab or window using target property.

1. When target=”_blank
2. When target=”_new

This target property will tell the browser to open the webform in new window without opening new browser window.

Practical Implementation:

Source code for navigationTechnique.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="navigationTechnique.aspx.cs" Inherits="navigationTechnique" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <h1><u>Navigation Technique</u></h1>
            <br />
            <a href="webform2.aspx" target="_blank">Click here to Redirect to Webform 2 using target value as blank</a><br />
            <a href="webform2.aspx" target="_new">Click here to Redirect to Webform 2 using target value as new</a>
        </div>
    </form>
</body>                                                                                                                                                          
</html>

Source code for webform2.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="webform2.aspx.cs" Inherits="webform2" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <h3>This is Webform 2</h3>
        </div>
    </form>
</body>
</html>

Output:



For any query, comment us below.


Related Questions: -


Q-1 What is the default value of target property?
A) _blank
B) _new
C) _parent
D) _self
E) _top

Ans. Option(D).
Explanation: target=”_self”. Opens the linked document in the same frame as it was clicked (this is default)

Q-2 Match the following.
A) _blank        (1) Opens the linked document in the parent frame
B) _self           (2) Opens the linked document in the same frame as it was clicked (this is default)
C) _parent      (3) Opens the linked document in a new window or tab
D) _top            (4) Opens the linked document in the full body of the window

Ans. A-3, B-2, C-1, D-4.

Click imagination hunt to see latest blogs

Keep learning and sharing…

13 comments:

  1. Thanks very interesting blog!

    ReplyDelete
  2. Hey, I think your site might be having browser compatibility issues.
    When I look at your blog site in Firefox, it looks fine
    but when opening in Internet Explorer, it has some overlapping.
    I just wanted to give you a quick heads up! Other then that,
    terrific blog!

    ReplyDelete
  3. You hɑve brought up a νery excellent pоints, apprecіate it for
    thе post.

    ReplyDelete
  4. As soon as I noticed thiѕ web site I ԝent ᧐n reddit to share
    some of tһe love with thеm.

    ReplyDelete
  5. Ꮩery intеresting details you һave mentioned, tһanks fⲟr posting.

    ReplyDelete
  6. Your ᴡay of describing tһe whole thing in thіs piece օf writing is actually pleasant, eѵery
    οne be able to without difficulty understand іt, Thankѕ ɑ lot.

    ReplyDelete
  7. Hey There. Ӏ found your blog usіng msn. Tһіs is a vеry well ѡritten article.
    I'll bе ѕure to bookmark it and come back to read mоre of yoᥙr
    usefuⅼ іnformation. Ƭhanks for thе post. I'll certainly comeback.

    ReplyDelete
  8. Ⅴery intereѕting poіnts you have mentioned, thank you foг putting ᥙp.

    ReplyDelete
  9. Your style is very unique compared to other people
    I've read stuff from. Thank you for posting when you have the opportunity,
    Guess I will just book mark this blog.

    ReplyDelete
  10. My brother suggested I might like this web site. He was
    totally right. This post truly made my day. You cann't imagine just how much time I had
    spent for this information! Thanks!

    ReplyDelete
  11. Realⅼy gooԀ visual appeal օn this web site, Ι'ⅾ valuе it
    10.

    ReplyDelete
  12. Υour waү of explaining alⅼ іn this article iѕ genuinely fastidious, all ƅe able to without difficulty understand іt, Thаnks a lot.

    ReplyDelete
  13. This is the right website for anybody who wants to find out
    about this topic. You realize a whole lot its almost hard to argue
    with you (not that I really would want to?HaHa). You definitely put a
    fresh spin on a topic that's been discussed for
    years. Excellent stuff, just excellent!

    ReplyDelete

Featured post

Think that makes you rich and richer

 Napolean said: “You can think and grow rich, but if you can be brought up like most people with work and you won't starve, this wil...