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…

7 comments:

  1. Thanks very interesting blog!

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

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

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

    ReplyDelete
  5. There is certainly a lot to find out about this topic. I like all of the
    points you have made.

    ReplyDelete
  6. Remarkable! Its really remarkable article, I have got
    much clear idea about from this article.

    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...