What is the best layout for updating content without updating the entire page on an ASP.NET web page?

I am a novice web development and ASP.NET developer. I am creating a web application (not public, therefore SEO, bookmarking, etc. It has nothing to do) with a typical header location on top, left navigation, content on the right. I want the content to refresh without overloading the entire page when I select something in the navigation bar. What is a typical way to implement this? MasterPage with ContentPages and with UpdatePanel (tried this, but it doesn't seem to work, I think, because the URL is different for each page of content)? Using frames? Using iFrame for a piece of content? UserControls for a piece of content?

Thanks Timo

+3
source share
5 answers

JQuery is good stuff, but I think that in some situations UpdatePanels will make a case. If you are creating a private site that you do not expect to grow to support a crazy amount of users, it will probably be easier for you to get started with UpdatePanels. UpdatePanels are made more for rapid development and prototyping and can go a long way. You can always change them one on one in the future, if you find the right one.

, MasterPage , - (aspx, MasterPage) , . UpdatePanels , AJAX. , , User Controls .

+2

AJAX , , . jQuery Rafael .


2 , , , :

  • - , - , . , "", , , , , .. Javascript .

  • - , , , URL-, , , . , URL- URL- AJAX, , . , URL- , , - , , . , , - , , , , : " ?"

, , , , .

+2

ASP.NET MVC, . jQuery ( javascript, YUI, MooTools, ummm ), .

, , "" - div, .

: http://www.asp.net/mvc/tutorials : http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery

+1

If you want to try jQuery and delete using asp.net in general to help separate the concepts or technologies that you are learning, you can simply use jQuery with html to have a page with a menu that is "without postback" loaded into the content .. .

index.html

<html>
<head>
    <title>A website</title>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

    <script type="text/javascript">

        $(function() {

            $(".navigation a").click(function() {

                $("#content").load($(this).attr("href"));

                return false;
            });

        });
    </script>

</head>
<body>
    <ul class="navigation">
        <li><a href="content-1.html">Content 1</a></li>
        <li><a href="content-2.html">Content 2</a></li>
        <li><a href="content-3.html">Content 3</a></li>
    </ul>

    <div id="content">
    </div>

</body>
</html>

content-1.html

<h1>Content 1</h1>
<p>Hello there...</p>

content-2.html

<h1>Content 2</h1>
<p>etc etc etc</p>

and then you can just create sample html pages (insert two extremely simple pages) and the content will be loaded into your div ... and from there you can clearly deploy many ways!

+1
source

Source: https://habr.com/ru/post/1761315/


All Articles