Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions HotelCore.Web/App_Start/RouteConfig.cs

This file was deleted.

2 changes: 0 additions & 2 deletions HotelCore.Web/App_Start/RouteConfig.vb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ Imports Microsoft.AspNet.FriendlyUrls

Public Class RouteConfig
Public Shared Sub RegisterRoutes(ByVal routes As RouteCollection)
' Enable Friendly URLs
routes.EnableFriendlyUrls()

' Custom routes for clean URLs
routes.MapPageRoute("Home", "", "~/Default.aspx")
routes.MapPageRoute("Facilities", "facilities", "~/Facilities.aspx")
routes.MapPageRoute("Contact", "contact", "~/Contact.aspx")
Expand Down
7 changes: 5 additions & 2 deletions HotelCore.Web/Global.asax.vb
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@

Imports System.Web.Optimization
Imports System.Web.Routing

Public Class Global_asax
Inherits HttpApplication

Sub Application_Start(sender As Object, e As EventArgs)
' Fires when the application is started
RouteConfig.RegisterRoutes(RouteTable.Routes)
BundleConfig.RegisterBundles(BundleTable.Bundles)
End Sub
End Class
6 changes: 2 additions & 4 deletions HotelCore.Web/HotelCore.Web.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
<Import Include="System.Web.UI.HtmlControls" />
</ItemGroup>
<ItemGroup>
<Content Include="App_Start\RouteConfig.cs" />

<Content Include="Content\css\bootstrap.min.css" />
<Content Include="Content\css\elegant-icons.css" />
<Content Include="Content\css\flaticon.css" />
Expand Down Expand Up @@ -185,9 +185,7 @@
<Content Include="Scripts\jquery.slicknav.js" />
<Content Include="Scripts\main.js" />
<Content Include="Scripts\owl.carousel.min.js" />
<Content Include="ViewSwitcher.ascx" />
<Content Include="ViewSwitcher.ascx.cs" />
<Content Include="ViewSwitcher.ascx.designer.cs" />

<Content Include="Web.config" />
</ItemGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion HotelCore.Web/Shared/Site.Master
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%@ Master Language="VB" AutoEventWireup="false" CodeBehind="Site.Master.vb" Inherits="HotelCore.Web.Site.Master" %>
<%@ Master Language="VB" AutoEventWireup="false" CodeBehind="Site.Master.vb" Inherits="HotelCore.Web.SiteMaster" %>

<!DOCTYPE html>

Expand Down
13 changes: 2 additions & 11 deletions HotelCore.Web/Shared/Site.Master.vb
Original file line number Diff line number Diff line change
@@ -1,30 +1,23 @@
Imports System.Web.Security
Imports System.Web.Security

Public Class Site1
Public Class SiteMaster
Inherits System.Web.UI.MasterPage

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

End Sub

Protected Sub lnkLogout_Click(sender As Object, e As EventArgs)
' Clear session
Session.Clear()
Session.Abandon()

' Clear authentication cookie
FormsAuthentication.SignOut()

' Redirect to home page
Response.Redirect("~/Default.aspx")
End Sub

Protected Sub btnSubscribe_Click(sender As Object, e As EventArgs)
' Handle newsletter subscription
Dim email As String = txtNewsletter.Text.Trim()

If Not String.IsNullOrEmpty(email) Then
' Validate email format
Try
Dim addr = New System.Net.Mail.MailAddress(email)
If addr.Address <> email Then
Expand All @@ -36,9 +29,7 @@ Public Class Site1
Return
End Try

' In a real implementation, save to database or email service
txtNewsletter.Text = ""
' Show success message via JavaScript
ScriptManager.RegisterStartupScript(Me, Me.GetType(), "NewsletterSuccess", "alert('Thank you for subscribing!');", True)
End If
End Sub
Expand Down
2 changes: 1 addition & 1 deletion HotelCore.Web/Web.config
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<httpRuntime targetFramework="4.8" />
</system.web>
<connectionStrings>
<add name="HotelCoreDB" connectionString="Data Source=NAYANWINDOWS\SQLEXPRESS;Initial Catalog=HotelCore;Integrated Security=True;Encrypt=False" providerName="System.Data.SqlClient" />
<add name="HotelCore" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=HotelCore;Integrated Security=True;Encrypt=False" providerName="System.Data.SqlClient" />
</connectionStrings>
<system.codedom>
<compilers>
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ Update the connection string in `HotelCore.Web/Web.config`:

```xml
<connectionStrings>
<add name="HotelCoreDB"
connectionString="Server=YOUR_SERVER;Database=HotelCoreDB;Trusted_Connection=True;MultipleActiveResultSets=true"
<add name="HotelCore"
connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=HotelCore;Integrated Security=True;Encrypt=False"
providerName="System.Data.SqlClient" />
</connectionStrings>
```

Replace `YOUR_SERVER` with your SQL Server instance name (e.g., `localhost`, `.\SQLEXPRESS`, etc.)
Replace `.\SQLEXPRESS` with your SQL Server instance name if different.

### 4. Build and Run

Expand Down