Adding New Pages In Asp.Net Application (ASP.Net 3 of 44)
Summary
TLDRThis tutorial demonstrates how to add new pages to an existing web application using ASP.NET and navigate between them. It covers creating a default page, adding a new web form, and linking pages using hyperlink controls, converting text to hyperlinks, and drag-and-drop navigation. The video also explains setting a startup page to ensure the application always begins from a specified page, offering various methods to manage page transitions effectively.
Takeaways
- 📝 The demo is about adding new pages to an existing web application and navigating between them using ASP.NET features.
- 🔨 It starts with creating a default page and adding a message to it, saving the changes.
- 🚀 Demonstrates adding a new page by right-clicking the project, selecting 'Add New Item', and choosing a Web Form named 'my page'.
- 🔗 Shows how to link the default page to the new page using a hyperlink control, setting its properties to navigate to 'my page'.
- 🖌️ Explains editing the hyperlink text to 'my page' and setting the navigation URL to redirect to the new page.
- 🔄 Describes navigating between pages by clicking on the hyperlink, which is tested in the execution.
- 🔄 Another method of navigation is converting a text link to a hyperlink using the 'Convert to Hyperlink' icon.
- 🔗 A third method is dragging and dropping a page from Solution Explorer to create a link directly to it.
- 🔑 Highlights creating a button on the page and using the 'btn_my_page' click event to redirect to 'my page' with Response.Redirect.
- 🏁 Discusses setting the default page as the startup page so that the application always begins from this page, regardless of the current page.
- 🛠️ Concludes by emphasizing the simplicity of adding multiple pages and navigating between them using various methods in ASP.NET.
Q & A
What is the main topic of the video demo?
-The main topic of the video demo is how to add new pages to an existing web application and navigate through different pages using features in ASP.NET.
What is the default page provided when creating a new web application in ASP.NET?
-The default page provided when creating a new web application in ASP.NET is typically named 'Default.aspx' or 'Index.aspx'.
How can you add a new page to an ASP.NET web application?
-You can add a new page to an ASP.NET web application by right-clicking on the project in Solution Explorer, selecting 'Add New Item', choosing 'Web Form', and naming it.
What is the purpose of the 'hl' prefix in the hyperlink property window?
-The 'hl' prefix in the hyperlink property window is used to indicate that the hyperlink will link to a specific page, making it clear for developers what the hyperlink is intended to do.
How can you link one page to another using a hyperlink in ASP.NET?
-You can link one page to another by dragging and dropping a hyperlink control, setting its properties to link to the desired page using the 'NavigateURL' property, and specifying the link text.
What is the alternative method to create a hyperlink to a page without using the hyperlink control?
-An alternative method to create a hyperlink is by writing the page link directly and using the 'Convert to Hyperlink' icon to transform it into a clickable hyperlink.
How can you navigate to another page using an anchor tag in HTML?
-You can navigate to another page using an anchor tag by specifying the 'href' attribute with the path to the desired page, which is created when you drag and drop the page onto the HTML editor.
What is the purpose of the 'btnMyPage' button in the video demo?
-The 'btnMyPage' button is used to demonstrate how to navigate to another page when the button is clicked, by using the 'Response.Redirect' method in the button's click event handler.
How can you ensure that the application always starts from the default page?
-You can ensure that the application always starts from the default page by right-clicking the default page in Solution Explorer and selecting 'Set as Start Page'.
What happens when you set a page as the startup page in an ASP.NET application?
-When you set a page as the startup page, the application will always navigate to this page when it is executed, regardless of which page you were on when you stopped the execution.
How can you add a button to navigate to a specific page on a click event in ASP.NET?
-You can add a button to navigate to a specific page by dragging and dropping a button control onto the page, writing the navigation code in the button's click event handler using 'Response.Redirect', and setting the button's text.
Outlines
🛠️ Adding and Navigating Pages in ASP.NET Web Applications
This paragraph demonstrates the process of adding new pages to an existing web application using ASP.NET. It starts by introducing the 'add pages example' and proceeds to show how to create a default page with a message. The speaker then guides through the steps of adding a new web form page named 'my page', writing content for it, and linking it to the default page using a hyperlink control. The hyperlink is configured to navigate to 'my page' upon clicking. Several methods for creating navigation links are discussed, including using standard controls, converting text to hyperlinks, and dragging pages directly from the Solution Explorer. The paragraph concludes with a demonstration of navigating between pages and emphasizes the simplicity of adding and linking pages in ASP.NET.
🔄 Navigating Pages and Setting Startup Options in ASP.NET
The second paragraph continues the tutorial on web application development, focusing on navigating between pages and setting startup options in ASP.NET. It begins with the addition of a button control to a page, named 'btn my page', which when clicked, is intended to redirect the user to 'my page'. The speaker writes the necessary code for the button's click event to perform the redirection using the 'Response.Redirect' method. The paragraph then illustrates different ways to navigate to 'my page', such as setting it as the startup page, which ensures the application always begins at the default page regardless of the user's current location within the application. The speaker emphasizes the flexibility of navigation options and the ease of setting a startup page in ASP.NET, concluding with a demonstration of the application's navigation functionality.
Mindmap
Keywords
💡Web Application
💡ASP.NET
💡Default Page
💡View
💡Solution Explorer
💡Web Form
💡Hyperlink
💡Property Window
💡Navigate URL
💡Button Click Event
💡Startup Page
Highlights
Introduction to adding new pages to an existing web application using ASP.NET.
Creating a default page with a message indicating it is the default page.
Adding a new web form page to the project via the Add New Items dialog.
Naming the new page 'my page' and adding it with a code-behind file.
Writing a message on the new page to distinguish it from the default page.
Linking the new page to the default page using a hyperlink control.
Setting the hyperlink properties to navigate to the new page when clicked.
Demonstrating how to execute the application and navigate between pages.
Using the 'Convert to Hyperlink' feature to create a clickable link to the new page.
Exploring different ways to navigate between pages, including drag and drop.
Creating a button on the page and setting it to redirect to the new page upon click.
Writing code for the button click event to perform the page redirection.
Executing the application to show the button click navigation in action.
Discussing the importance of setting a startup page for the application.
Demonstrating how to set a default page as the startup page.
Highlighting that the startup page will be loaded regardless of the current page.
Conclusion summarizing the simplicity of adding and navigating between pages in ASP.NET.
Transcripts
hello in this demo i am going to show
you how to add new pages to our existing
web application or to an application and
how to navigate through different pages
with the help of different features that
we have in our asp.net so i'm going to
name it as
add
pages example
let's say okay
so as usual it is going to give me a
default page
and i will just go for the view and
solution explorer i have got default
page now in this default page
i'll write some message saying that this
is
my
default page
i'll save this now if i want to add one
more page
as we have default in the same sense i
can just select my project
right click on it
and i'll say add new items
and i am going to select a web form and
i'll name it as
my page
and i'll simply say add
so it has added me my page with
code behind
file along
with it
now i'll just go to the design and here
i'll write it as
this
is
my page
now i'll go back to my default page and
what i want
i want to link
this page with my page so i can simply
go to the standard controls and i can
drag and drop a hyperlink
i can go to the properties
and in property window i can name it as
hl prefix
hyperlink with hl
hl
my page so that
we will come to know that it is going to
link to my page and the text
instead of hyperlink i will just write
it as
my page
and whenever i click on this link it
should navigate me to
navi with the help of navigate url i can
set that it should redirect me to my
page i'll just browse this and here i
have got all the pages of my solution
explorer i'll just select my page and
i'll say okay
so whenever i click on my page link it
is going to take me to
my page i'll save this
and i'm going to execute this now i am
on default aspx page whenever i click on
my page it should take me to my page
so i'm on my page i can go back again
click on my page i'm coming on my page
i'll simply close this
stop the execution
this is one way to navigate from one
page to another page
another way is simply you can write my
page
link
and i'll select this
and i'll just go for convert to
hyperlink icon the same icon we have in
our word document
and i'll click on this
and here i'll just say browse
and i'll browse to my page
say okay and i'll execute this
this is going to work in the same sense
it is going to
put an anchor tag for me an html anchor
tag
it takes me to my page
another way or the easiest way is very
simple you have your my page over on the
right
in your solution explorer just select
that page drag and drop it
so you'll get a link to that particular
page
i'll run this
if i click on my page it should take me
to that page
now this is one of the many ways
of navigating from one page to another
page
now
the last thing that i want to show you
is
on a button click
so i have a button i have dragged and
dropped the button on my page these are
the standard controls anyway we are
going to see these controls in our next
video in depth each and every control
now i take a button
i'll name it as
btn
my page
and whenever i click on this it should
take me to my page so just i'll just put
the text as my page
on the button click it should redirect
me to my page so i'll just double click
the button and i'll write the code
anything related to that button click in
button underscore click event
so
the event that i get whenever i click
the button is
click event so id of the button
underscore click so whenever i click the
button this code gets executed whatever
i write in this open bracket and close
the bracket so i'll just try to redirect
my control from default page to my page
so i'll say
response dot
redirect
to
my page
dot aspx
and i'll execute this
now whenever i click the button it
should take me to my page
so i'm on my page so i have shown you
many ways
of navigating from one page to another
page so we'll be using
anyone depending upon our situations
now if i am on my page and execute my
application
so it is going to take me to my page
directly
now what i want is
wherever i may be i may be on page xyz
or whatever it may be it should start
from default page so i can select the
default page i can make it as a startup
page
i just right click it and i'll say set
as start page
and if at all i am on my page and
execute my application it will take me
to the default page by default because
it is the startup page even if you have
100 pages and if i'm on 99th page it
will take me to the first page whatever
i have set as set as startup page
so that's it so this is very simple to
add multiple pages to your application
you can do in this way and you can
navigate from one page to another page
using one of the many ways that we have
thank you very much
you
Browse More Related Video
Give a New Look to Form Page Interactive Report - Part 15(A)
Managing Events Using Calendar Page - Part 36
How To Use Divi Theme | Complete Step-By-Step Tutorial for Beginners
All about Firebase Authentication 🔥 | Login & Signup | Jetpack Compose
HTML Tutorial For Beginners | Learn HTML In 30 Minutes | Designing A Web Page Using HTML | Edureka
Routing | Mastering React: An In-Depth Zero to Hero Video Series
5.0 / 5 (0 votes)