Revolutionary newspaper design utilizing asp.net's C# web forms

Trying to create a dynamic newspaper layout using ASP.NET C# web form. Struggling to set the page layout size inside a slider and display specific news content on a new page when clicking on an area of the newspaper using Repeater or another suitable control.

Below is all of my code:

<head runat="server">
<title></title>

... (Code continues) ...

Attempting to achieve a layout similar to the following URLs:

Note:

Big image size is 900*552.

... (Additional notes) ...

The provided code was sourced from Google, but I'm aiming for a result similar to the examples referenced above.

Answer №1

To gain inspiration, review the following code snippets...

window.onload = function () {
        // display default image(Big image and small image) when first opened
        //eq(index) can retrieve object by index
        $(".smallbox .subbox").eq(0).trigger("click");
    }
    //set a global variable index
    var index;
    $(function () {
        //clicking on small box captures this index and displays the Big image with this index
        $(".smallbox .subbox").click(function () {
            $("#BigImg").attr("src", $(this).find("img").attr("data-big"));
            $(".smallbox .subbox").removeClass("NewSty");
            $(this).addClass("NewSty");
            this.scrollIntoView(false);
        })
    });
    function LeftChange() {
        $(".NewSty").prev().trigger("click");
    }
    function RightChange() {
        $(".NewSty").next().trigger("click");
    }
* {
        margin: 0;
        padding: 0;
    }

::-webkit-scrollbar {
    width: 10px;
}

    #Box {
        height: 300px;
        width: 600px;
        border: 1px solid red;
    }

    .smallbox {
        width: 100px;
        height:100%;
        border: 1px solid purple;
        overflow-y: auto;
        overflow-x: auto;
        float:left;
    }

    .subbox {
        border: 1px solid yellow;
    }
    .subbox img{width:100%; height:100%;}

    #bigbox {
        width: 300px;
        height: 550px;
        border: 1px solid black;
      float:left;
      margin: 10px;
    }

    #bomdiv {
        width: 500px;
        height: 100px;
    }

    #ImageButton2 {
        margin-top: 10px;
        margin-left: 150px;
    }

   .NewSty {
     border : 2px solid blue;
        /*box-shadow: 10px 10px 5px blue;*/
    }

.newsArea{
  position:absolute;
  text-decoration:none;
  background-color: rgba(0,0,255,.1);
 }

.newsArea:hover{
    background-color: rgba(0,0,255,.5);
  }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<form id="form1" runat="server">
    <div id="Box">
        <div class="smallbox">
            <div class="subbox">
                <a href="#">
                    <img alt="" src="http://epaper.tribune.com.pk/Images/Karachi/20170109/11201701090003_Thumb.JPG" data-big="http://epaper.tribune.com.pk/Images/Karachi/20170109/11201701090003.JPG"/>
                </a>
            </div>
            <div class="subbox">
                <a href="#">
                    <img alt="" src="http://epaper.tribune.com.pk/Images/Karachi/20170109/11201701090003_Thumb.JPG" data-big="http://epaper.tribune.com.pk/Images/Karachi/20170109/11201701090003.JPG"/>
                </a>
            </div>
            <div class="subbox">
                <a href="#">
                    <img alt="" src="http://epaper.tribune.com.pk/Images/Karachi/20170109/11201701090003_Thumb.JPG" data-big="http://epaper.tribune.com.pk/Images/Karachi/20170109/11201701090003.JPG"/>
                </a>
            </div>
            <div class="subbox">
                <a href="#">
                    <img alt="" src="http://epaper.tribune.com.pk/Images/Karachi/20170109/11201701090003_Thumb.JPG" data-big="http://epaper.tribune.com.pk/Images/Karachi/20170109/11201701090003.JPG"/>
                </a>
            </div>
  
            <!-- more code here -->

Answer №2

Streamline your HTML code by using a Repeater.

For instance, if you have a list of items like this:

<div class="subbox">
   <a href="#"><img alt="" src="{...}.jpg" /></a>
</div>

Instead of repeating

<div class="smallbox">...</div>
, you can utilize a Repeater:

<div class="smallbox">
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
   <div class="subbox">
       <a href="#"><img alt="" src="<%# Container.DataItem.ToString() %>" /></a>
   </div>
</ItemTemplate>
</asp:Repeater>
</div>

You can then populate the Repeater with data like this:

List<string> data = new List<string>() { "Small0.jpg", "Small1.jpg", "Small2.jpg" };
Repeater1.DataSource = data;
Repeater1.DataBind();

By doing so, you can achieve the same output HTML code but with different images:

<div class="subbox">
    <a href="#"><img alt="" src="Small0.jpg" /></a>
</div>
<div class="subbox">
    <a href="#"><img alt="" src="Small1.jpg" /></a>
</div>
...

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Arrangement of elements across rows and columns in a grid pattern

Is it possible to span a column that is equivalent to two columns in the first row and then have one column each for the second row, as shown in the screenshot? (There are two columns in the second row in this case) CSS main section { display: grid; ...

Connect to dynamically generated div on separate page

I am facing an issue with my navigation bar drop down menu that displays event titles fetched from the database. I want users to be able to click on a specific event and have the page scroll to the dynamically generated content for that event. However, it ...

Arranging multiple Label and Input fields in HTML/CSS: How to create a clean and

I'm struggling with HTML and CSS, trying to figure out how to align multiple elements on a page. I've managed to line up all the rows on the page, but for some reason, the labels are appearing above the input fields when I want them to appear be ...

Incorporating a technique for aligning text towards the right as the number of characters or digits expands

I'm designing a game user interface with a money indicator. Let's imagine the player has 0 dollars in their wallet, it should appear like this: https://i.stack.imgur.com/35eoh.png Please note that it is located in the upper right corner. The p ...

Guide on creating frozen columns in an Angular 2 table with the ability to scroll through multiple columns

Within my table, there are 3 columns that must always remain on the left side. Additionally, there is a column containing a grid where each element represents an hour of the day, requiring it to be scrollable. I have attempted various proposed solutions, ...

Tips for updating the font color of BarMenu in Blazorise

I am struggling to change the default font color of the bar menu to red in a razor page. Despite trying the code below, it doesn't seem to work: <Bar Breakpoint="Breakpoint.Desktop" Background="Background.Light" ThemeContr ...

What is the simplest way to shift an icon to the right in the header of an Expansion panel using Vuetify

After implementing the template from this example: https://vuetifyjs.com/en/components/expansion-panels/#usage I am facing an issue where the header icon is stuck to the title Even applying "float: right;" does not seem to resolve it Has anyone els ...

Is it possible to incorporate a CSS3 transition into the styling of a list of images?

Looking to achieve a CSS3 linear transition for a "list-style-image" specifically for Firefox? You'll need to include "-moz-" in your code. -moz-transition: list-style-image 0.2s linear; However, the above code is not producing the desired result. I ...

Bring to life the div that has been clicked

There are three divs labeled as "left", "active", and "right" in my setup: Whenever the left div is clicked, it animates to become active and the previously active one moves into its place. I want this same functionality to apply to the right div as well. ...

Tips for embedding HTML/CSS snippets in backticks when using TypeScript with AngularJS

Does anyone else experience the issue of their Angular 2 templates showing up as gray text in Visual Studio Code? I'm unable to use autocomplete or see my CSS properly. Is this a settings problem or is there a plugin that can solve this? BTW, I am us ...

Use radio buttons to enable switching between different data options within a dropdown menu

I am working on a dropdown box that is populated dynamically using JSON data. The content in the dropdown can be categorized into 4 types, so I have included radio buttons to switch between these categories. I have created HTML code to toggle between manu ...

Switching the arrow direction in Bootstrap 4 menu toggles

I'm a beginner with Bootstrap 4. My navigation menu includes a dropdown item with the standard caret pointing down, added automatically by Bootstrap. Now, I want to make the caret point up after opening the dropdown menu for the nav item. Despite ext ...

Denied rendering of design due to incompatible MIME type

Just delved into the world of node / express and decided to test my skills by creating a simple tip calculator app. However, I seem to have hit a roadblock with loading my CSS. The console keeps throwing this error: "Refused to apply style from &apos ...

Introducing Bootstrap 5 with a sleek two-column layout that effortlessly allows text to wrap around captivating images

Struggling to find a solution for implementing two columns in a row? Look no further! In the left column, insert an image with classes md-3 or lg-4. In the right column, place a lengthy text using classes md-9 or lg-8. If you want the text to wrap around ...

Leveraging the :checked state in CSS to trigger click actions

Is there a way to revert back to the unchecked or normal state when clicking elsewhere in the window, after using the :checked state to define the action for the clicked event? ...

Can a single SVG file be referenced and reused multiple times in a project?

Instead of repeating these code blocks: <svg class="icon-user"> <use href="LONGFILENAME.svg#icon-user"> </use> </svg> <svg class="icon-user2"> <use href="LONGFILENAME.svg#icon-user2"> </use> </ ...

Move the focus to the previous input field by removing the key

I have created a phone number input with 10 fields that automatically skip to the next field when you fill in each number. However, I would like to be able to go back to the previous field if I make a mistake and need to delete a digit. How can I achieve ...

Production environment poses a challenge as Rails 4 struggles to locate fonts

Situation: I am facing an issue with my Rails 4.0.0 application deployed using capistrano, where the asset precompilation does not work properly on my production server. Challenge: Despite successfully adding a font and using it with @font-face locally, t ...

The background image doesn't extend to the bottom of the page due to the inability to utilize background-attachment

Currently, I am working on a project that requires a background image to cover the entire page. Unfortunately, using "background-attachment: cover" is not an option due to the need for compatibility with iOS, which does not support this property. .sky-b ...

Transforming the style of a particular element within React using Array().fill().map's method

Looking for a way to dynamically change the color of an array in React + styled jsx? Let's say you want to change the color when the number of elements in the array is a multiple of 4 (e.g. the index is 4, 8, etc.) Is there a clever solution to achi ...