Skip to content

Fix misleading docs for ActionLink and PageLink#66453

Open
GrantTotinov wants to merge 2 commits intodotnet:mainfrom
GrantTotinov:fix-actionlink-docs
Open

Fix misleading docs for ActionLink and PageLink#66453
GrantTotinov wants to merge 2 commits intodotnet:mainfrom
GrantTotinov:fix-actionlink-docs

Conversation

@GrantTotinov
Copy link
Copy Markdown

Fix misleading XML docs for ActionLink and PageLink

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

Summary of the changes (Less than 80 chars)
Fix misleading XML docs for ActionLink and PageLink

Description

ActionLink and PageLink always generate an absolute URL. When protocol
or host are null, the values are taken from the current HTTP request.
The previous documentation incorrectly implied that an absolute URL is
only generated when both parameters are non-null.

Updated the summary comments for both methods to reflect the actual behavior.

Fixes #42949

Copilot AI review requested due to automatic review settings April 24, 2026 02:24
@GrantTotinov GrantTotinov requested a review from a team as a code owner April 24, 2026 02:24
@github-actions github-actions Bot added the needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically label Apr 24, 2026
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Apr 24, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates MVC UrlHelperExtensions XML documentation to clarify that ActionLink and PageLink generate absolute URLs by defaulting protocol and host from the current HTTP request when those parameters are null.

Changes:

  • Update ActionLink summary to state it generates an absolute URL and defaults protocol/host from the current request when null.
  • Update PageLink summary to state it generates an absolute URL and defaults protocol/host from the current request when null.

Comment thread src/Mvc/Mvc.Core/src/UrlHelperExtensions.cs
Comment thread src/Mvc/Mvc.Core/src/UrlHelperExtensions.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Indicates that the PR has been added by a community member needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UrlHelperExtensions.ActionLink docs are misleading regarding requiring protocol and host

2 participants