Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Windows Tipps & SecurityNighthawk M7 Pro im Test: Flexibler, aber teurer 5G-Router(21.09.2026 um 10:30 Uhr)
Sichere ProgrammierungNeue Gmail-Funktion: So sparst du jetzt Zeit bei Einmalcodes(21.09.2026 um 10:00 Uhr)
Sichere ProgrammierungYour GIF exporter is fine — the container is the problem(21.09.2026 um 10:01 Uhr)
Sichere ProgrammierungCSS, Motion, or GSAP? I Choose by Who Owns the Animation(21.09.2026 um 10:12 Uhr)
Windows Tipps & SecurityNighthawk M7 Pro im Test: Flexibler, aber teurer 5G-Router(21.09.2026 um 10:30 Uhr)
Sichere ProgrammierungNeue Gmail-Funktion: So sparst du jetzt Zeit bei Einmalcodes(21.09.2026 um 10:00 Uhr)
Sichere ProgrammierungYour GIF exporter is fine — the container is the problem(21.09.2026 um 10:01 Uhr)
Sichere ProgrammierungCSS, Motion, or GSAP? I Choose by Who Owns the Animation(21.09.2026 um 10:12 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

Using the Segment Feature

Segment is an attribute that can be applied to ASPX pages. When this feature is enabled, all path parts that appear after the aspx file path are treated as segments and routed to the same executing page. Segment is one of the innovative…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Segment is an attribute that can be applied to ASPX pages. When this feature is enabled, all path parts that appear after the aspx file path are treated as segments and routed to the same executing page. Segment is one of the innovative ideas of the Elanat team. By enabling Segment, you gain full control over URL paths.









Enabling Segment






Razor Syntax






@page
+@segment
<!DOCTYPE html>
<html>
...









Standard ASPX Syntax






<%@ Page Segment="true" %>
<!DOCTYPE html>
<html>
...












How Segment Works



If you enable Segment on the following path:




/page/about.aspx






Any additional path parts after this address will be considered segments, and the executable file /page/about.aspx will still be executed.






Example






/page/about.aspx/segment1/segment2/.../segmentN






If Segment is enabled on a file such as:




/page/about/Default.aspx






You can still access it using both of the following formats:




/page/about/Default.aspx/segment1/segment2/.../segmentN






or




/page/about/segment1/segment2/.../segmentN












Accessing Segment Values



You can access Segment values in all three layers: View, Controller, and Model.



Segments are zero-based indexed.



Given the URL:




/page/about/segment1/segment2/segment3








  • Segment.GetValue(0) returns "segment1"


  • Segment.GetValue(1) returns "segment2"


  • Segment.GetValue(2) returns "segment3"



In general:




Segment.GetValue(n)






returns the segment at index n (starting from 0).









Example in View (Razor)






<b>segment 1 is: @Segment.GetValue(0)</b>
<b>segment 2 is: @Segment.GetValue(1)</b>









Example in View (Standard ASPX)






<b>segment 1 is: <%= Segment.GetValue(0) %></b>
<b>segment 2 is: <%= Segment.GetValue(1) %></b>









Example in Controller






using CodeBehind;

namespace YourProjectName
{
public partial class DefaultController : CodeBehindController
{
public void PageLoad(HttpContext context)
{
+ Write(Segment.GetValue(0));
+ Write(Segment.GetValue(1));
}
}
}






By activating Segment, you no longer need to use query strings to pass parameters through the URL.









Important Behavior



If you enable Segment on a specific path, ASPX view files located in its subdirectories will not be executed.






Example



If Segment is enabled on:




/page/about/Default.aspx






Then the following path will no longer be accessible:




/page/about/license/Default.aspx












Checking Segment Existence



You can use the Exist method to check whether a segment value exists before accessing it.




@if (!Segment.Exist(0))
{
<b>Value does not exist</b>
}












Segment in Default MVC Configuration



In the default MVC configuration, the Segment feature is enabled automatically in controller routing.




using CodeBehind;

public partial class user : CodeBehindController
{
public void PageLoad(HttpContext context)
{
Write(Segment.GetValue(0)); // path: /user/{id}
}
}












Rewrite ASPX Path as Directory



One of the interesting ideas introduced by the Elanat team in the CodeBehind framework is the ability to rewrite an aspx file path as a directory name.



When this option is enabled, routes leading to an aspx file without the .aspx extension will be treated as directory paths.




[CodeBehind options]; do not change order
...
rewrite_aspx_file_to_directory=true
...






Note: You can safely enable this option because this rewrite does not introduce any additional processing load.






Example



Access:




/page/contact.aspx






Using:




/page/contact






And also:




/page/contact/segment1/segment2/.../segmentN












Related links



CodeBehind on GitHub:

https://github.com/elanatframework/Code_behind



CodeBehind in NuGet:

https://www.nuget.org/packages/CodeBehind/



CodeBehind page:

https://elanat.net/page_content/code_behind

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Using the Segment Feature

Thematisch verwandte Begriffe: Using, Segment, Feature · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-94030 | A security vulnerability has been detected in SerenityOS up to 3d83e4509…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick