Simple example showing how to integrate Docsie documentation into ASP.NET Core Razor Pages applications. Works on Windows, macOS, and Linux with .NET 9.0+.
Clone and run:
git clone https://github.com/PhilippeTrounev/razor-pages-docsie-sample.git
cd razor-pages-docsie-sample/DocsieBlazorSample
dotnet runOpen https://localhost:5001/docs
Pages/Docs.cshtml:
@page
<link href="https://lib.docsie.io/current/styles/docsie.css" rel="stylesheet" />
<div data-ddsroot></div>
<script async src="https://lib.docsie.io/current/service.js"
data-docsie='docsie_pk_key:deployment_YOUR_ID'>
</script>- Server-side rendering with Razor Pages
- JWT authentication support
- Multi-language documentation
- Version control
- Full-text search
- Analytics tracking
For secured documentation, generate JWT tokens server-side:
Pages/Docs.cshtml.cs:
using System.IdentityModel.Tokens.Jwt;
using Microsoft.IdentityModel.Tokens;
public class DocsModel : PageModel
{
public string JwtToken { get; private set; }
public void OnGet()
{
JwtToken = GenerateJwtToken();
}
private string GenerateJwtToken()
{
var masterKey = Configuration["Docsie:MasterKey"];
var key = new SymmetricSecurityKey(
System.Text.Encoding.UTF8.GetBytes(masterKey));
var credentials = new SigningCredentials(
key, SecurityAlgorithms.HmacSha256);
var token = new JwtSecurityToken(
expires: DateTime.UtcNow.AddHours(1),
signingCredentials: credentials
);
return new JwtSecurityTokenHandler().WriteToken(token);
}
}Pages/Docs.cshtml:
<script async src="https://lib.docsie.io/current/service.js"
data-docsie='docsie_pk_key:@Model.DeploymentId,authorizationToken:@Model.JwtToken'>
</script>appsettings.json:
{
"Docsie": {
"DeploymentId": "deployment_YOUR_ID",
"MasterKey": "your_master_key_here"
}
}Use environment variables in production:
Docsie__DeploymentId=deployment_YOUR_ID
Docsie__MasterKey=your_master_key_hereDocsieBlazorSample/
├── Pages/
│ ├── Docs.cshtml # Documentation page
│ ├── Docs.cshtml.cs # Code-behind
│ └── Shared/
│ └── _Layout.cshtml # Layout
├── Program.cs
└── appsettings.json
Blank page?
- Check browser console for errors
- Verify deployment ID is correct
- Ensure
service.js(notstyles.js) is loaded
Authentication failing?
- Verify master key matches your deployment
- Check token hasn't expired
- Validate token at jwt.io
Port conflict?
- Change port in
Properties/launchSettings.json - Kill existing process:
lsof -ti:5000 | xargs kill -9
- Blazor WebAssembly - Client-side Blazor integration
- React integration (coming soon)
- Vue.js integration (coming soon)
- Next.js integration (coming soon)
- .NET SDK 9.0+ (compatible with .NET 6.0+)
- Modern web browser
- Docsie account
Embed product documentation directly in your ASP.NET application. Users get contextual help without leaving your app. Supports versioning to match your software releases.
Create interactive API documentation portals. Include code examples, request/response samples, and authentication guides. Version your API docs alongside your API releases.
Build self-service knowledge bases for customer support. Reduce support tickets by providing searchable documentation. Track which articles users read most.
Add contextual help tooltips and guides within your application. Improve user onboarding and feature discovery. Update help content without redeploying your app.
Host developer documentation, architecture guides, and internal wikis. Keep technical docs version-controlled and synced with your codebase.
Create employee onboarding documentation and training courses. Track completion and engagement through analytics. Support multiple languages for global teams.
Maintain policy documents, compliance guides, and regulatory documentation. Control access with JWT authentication. Audit who reads critical documents.
Build customer-facing help centers within your SaaS application. Secure documentation per customer using multi-tenant authentication. Brand documentation to match your company style.
- Discord: https://discord.gg/rptfXQnq
- Email: hello@docsie.io
- Issues: GitHub Issues
MIT