Skip to content

FadingPandaa/ViewBag-Demo

Repository files navigation

📖 Project Overview

This project is an ASP.NET MVC web application focused on using ViewBag to transfer data between controllers and views.

It demonstrates how dynamic data can be passed and displayed in a structured web application using the MVC pattern.

Key concepts:

  • MVC architecture (Model-View-Controller)
  • ViewBag for dynamic data transfer
  • Controller-to-view communication
  • Razor view rendering

🚀 Features

✅ Use of ViewBag for passing data

✅ Dynamic content displayed in views

✅ MVC structure (Controllers, Views)

✅ Page routing and navigation

✅ Clean separation of concerns


🛠️ Technologies Used

  • C#
  • ASP.NET MVC
  • Razor Views
  • HTML5 & CSS
  • Visual Studio

▶️ How to Run

Using Visual Studio:

  1. Open the solution file
  2. Build the project
  3. Click Run (IIS Express)

Use .NET CLI: dotnet build, dotnet run


🔄 How It Works

  1. The controller assigns values to ViewBag
  2. The view accesses ViewBag data dynamically
  3. The data is rendered on the page
  4. Users interact with the displayed content

⚠️ Limitations

  • ViewBag is loosely typed (less safe than models)
  • Limited data validation
  • Basic UI design

📈 Future Improvements

  • Replace ViewBag with strongly typed models
  • Add database integration
  • Improve UI/UX design
  • Implement forms and user input handling

👨‍💻Author:

Keabetswe Masole

Software Used:
Visual Studio 2022

About

ASP.NET MVC application demonstrating the use of ViewBag to pass dynamic data from controllers to views, highlighting data sharing, routing, and structured web development.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors