Use Playwright for .NET to open your running ASP.NET site in a browser configured with a mobile-device profile, then capture the page with Page.ScreenshotAsync(). ASP.NET does not provide a built-in screenshot API in this workflow: a separate .NET console app, test, or other process launches Playwright and visits a URL the process can reach. The result is a repeatable mobile-emulation screenshot, not proof of how the site behaves on a physical phone.
What “mobile screenshot with ASP.NET” means
The ASP.NET part is the website being captured, or the .NET environment in which the capture code runs. The screenshot mechanism is Playwright controlling a browser. It can be used against a locally running application, a test deployment, or another accessible site; the browser process must be able to reach the URL you provide.
For repeatable layout checks, mobile emulation sets browser characteristics such as viewport, screen dimensions, user agent, and touch support. A device preset bundles these settings, so a named profile is usually easier and less error-prone than choosing each value yourself. Presets are a registry, not a guarantee that a particular phone name will remain available forever; inspect the installed Playwright device registry when selecting one.
This is not the same as running the site on a real phone. Emulation does not establish behavior on physical hardware, nor does it reproduce every mobile browser quirk, sensor, or real-world condition. Use a real device when those are what you need to validate.
Recommended Free Tools
#1 Best Overall
- FEATURE: the tripod phone mount is adjustable by screw mechanism, 360 degree rotating, vertical(portrait mode) and horizontal(landscape mode) or any angle as you need, not necessary to take your cell phone out of a standard tripod or small tripod.
- EASY TO USE: two options for using tripod phone holder: 1. screw it directly to the tripod or selfie stick with pivoting arm, being able to 360 degrees rotating, 2. remove the phone clamp from pivoting arm and then mount on a tripod or monopod.
- ADJUSTABLE WIDTH: 2.2inch-4.1inch(55mm-105mm), attachable to any regular-size smartphone, tripod, selfie stick, monopod or camera; two standard 1/4 x 20mm female thread interfaces meeting your various needs. Very functional and compact.
- MATERIAL: the black part made of sturdy plastic, the female threads inserted are brass, the male screw is steel and soft non-slipping silica gel pads, which protect your cellphone from scratch and hold the phone securely.
- ATTACHABLE TO: most mobile phones, tripods, unipods, selfie sticks, cameras, camcorders, pico projectors, including iPhone 11/11 Pro/11 Pro Max/X/XS/XR/XS Max/8/7/6/6s Plus/SE/5s/5/5c, Samsung Galaxy S10/10+/S9/S9+/S8/S8+/S7/S6/S6 edge, Note10/10+/9/8 and Android phones.
Set up Playwright .NET
-
Create a .NET console or test project, then add the
Microsoft.PlaywrightNuGet package. The code below is a console-app-shaped example; it can also be adapted to a test or a utility project. -
Build the project. Playwright’s .NET setup workflow generates an installation script in the build output. Run the script for your target framework from the corresponding
bin/Debug/netX/directory, substituting your actual target-framework output folder. This installs the browser binaries used by Playwright. -
Keep the installed browser binaries aligned with the Playwright package version. Playwright versions require specific browser builds; after upgrading the package, rerun the browser installation step. For Linux or continuous-integration environments, follow the browser installation guide’s documented OS dependency and install options.
-
Make sure the target ASP.NET site is running and that the machine or CI worker launching the browser can reach its URL. A URL that works on your development machine may not be reachable from a container or remote worker.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
For example, start the ASP.NET application separately and pass its actual reachable address to the capture program. Do not assume that starting Playwright also starts your web application.
Capture a mobile viewport in C#
This complete minimal example uses the installed iPhone 13 device profile and saves a PNG of the currently visible viewport. Replace the example URL with the address of your running site.
Rank #2
- Dual Cold Shoe Mounts: Attach microphones, lights, and accessories for enhanced photography or vlogging.
- Versatile Screw Design: 1/4" screw hole compatible with tripods, selfie sticks, cameras, and various accessories.
- 360° Rotation, 180° Tilt: Effortlessly switch between landscape and portrait mode with adjustable angle design for precise control.
- Universal Phone Compatibility: Fits smartphones from iPhone 14 to Galaxy S23 Ultra, accommodating devices within 2.16" to 3.7" width. For best results, avoid clamping directly on the side buttons. Adjust the position slightly higher or lower if your phone has thick cases or protruding buttons.
- Secure Grip: Thick non-slip silicone pad ensures stability even with a thick phone case.
using Microsoft.Playwright;
using var playwright = await Playwright.CreateAsync();
await using var browser = await playwright.Chromium.LaunchAsync();
var device = playwright.Devices["iPhone 13"];
await using var context = await browser.NewContextAsync(device);
var page = await context.NewPageAsync();
await page.GotoAsync("https://your-running-site.example");
await page.ScreenshotAsync(new() { Path = "mobile.png" });
The browser context carries the emulated device settings; the page is opened inside that context. GotoAsync navigates to the target, and the default page screenshot captures the current viewport. The device profile is an example, not a required choice: use another available preset if it better matches the viewport you want to check.
Install and upgrade guidance is in the Playwright .NET library guide and browser guide. Match those instructions to the Playwright package version in your project.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchChoose what part of the page to capture
Visible viewport
The sample’s Page.ScreenshotAsync() captures the page’s current viewport. Use this for a mobile first-screen check, a test assertion, or a screenshot that should have a consistent viewport-sized canvas.
Entire scrollable page
Set FullPage = true to capture the full scrollable page instead of only the visible viewport:
await page.ScreenshotAsync(new()
{
Path = "mobile-full-page.png",
FullPage = true
});
A full-page image can be much taller than a viewport capture. It is useful for reviewing long-page layout, but choose it only when downstream use needs the entire page.
One component
Use a locator’s screenshot method to capture one element, such as a navigation panel or product card. The selector must identify the intended element on the loaded page.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Rank #3
- 🏆【Latest Metal Phone Tripod Mount】: 360° rotation smartphone holder with 2 side cold shoe and 1 back cold shoe & 1/4" Expand Hole Design, you can attach additional LED light, microphone or other film device. It helps you film steady vlogging video for Facebook, Youtube, and platforms as well as live streaming channels.
- 🏆【Back Cold Shoe & Two 1/4" Expand Hole Design】: There is a cold shoe on the back, which solves the problem that the wireless microphone cannot be fixed during mobile phone recording. Two 1/4" screw hole help you expand the devices you want.
- 🏆【Standard Arca Mount on Bottom】- ULANZI Iron Man IV with a standard Aka quick release plate port, quick installation. A 1/4 screw port is added at the bottom to connect tripods. It is all aluminum metal made. Solid, Durable and Safer.
- 🏆【Side Double Cold Shoe Design】: ULANZI ST-27 with 2 cold shoes on the side, you can mount your fill light & microphone at same time. It is be the best choice for your vlog.
- 🏆【Extra Wide Compatibility】: Ulanzi phone tripod mount compatible with iPhone17 16 15 14 13 12/12Pro/12Pro Max/11/11Pro/11Pro Max/X/Xs/XR/Xs Max,8/7/6/6s, iPhone 6/6s plus, iphone SE,Samsung Galaxy s10s10 plus S9/S9+,S8/S8+/S7/S6/S6 edge, Note 10 9 8 5 4 3 and many other brands and models
await page.Locator(".product-card").ScreenshotAsync(new()
{
Path = "product-card.png"
});
For an element that appears only after client-side rendering, wait for the relevant selector before capturing. A locator screenshot is often a more focused artifact than cropping a full-page image afterward.
Bytes instead of a file
Page.ScreenshotAsync() can return screenshot bytes when no path is supplied. This is useful when a test needs to compare or process the image without first writing a file. Specify a path when you want a saved artifact that is easy to inspect or attach to a build result.
Select a device profile, dimensions, and output scale
A named device profile is the convenient option for a repeatable emulated phone configuration. If the preset is unavailable or you need a nonstandard viewport, configure the context with explicit device characteristics instead; be deliberate about matching viewport and screen dimensions and any mobile or touch settings the test depends on. The available presets and configuration fields can vary with the installed Playwright version, so inspect that version’s device registry rather than relying on a model name as a permanent API.
Screenshot options also let you select PNG, JPEG, or WebP and choose CSS-pixel or device-pixel scale. Use CSS-pixel output when you want an image sized to the emulated CSS viewport. Device-pixel scale produces higher-density output and can increase file size. Pick the format and scale according to the consumer: visual review, image comparison, or storage and transfer constraints.
Free tools Windows power users keep installed
One-click scans. No signup required.
| Capture choice | Use it when | Trade-off |
|---|---|---|
| Viewport | You need the visible mobile screen. | Content below the fold is not included. |
| Full page | You need the whole scrollable document. | The resulting image can be substantially taller. |
| Element | You need a specific component for review or comparison. | The selector must target the correct rendered element. |
| CSS-pixel scale | You want output at the emulated CSS size. | It is not a higher-density device-pixel rendering. |
| Device-pixel scale | You need higher-density output. | Output dimensions and file size can be larger. |
Make captures repeatable and diagnose failures
A screenshot only records the browser state at capture time. Pages that render asynchronously may be incomplete if captured immediately after navigation. For pages with known client-side content, wait for a meaningful element before taking the shot; waiting on the whole network to become idle is not always a reliable substitute for knowing that the content you need has appeared.
Keep the target URL and emulated profile consistent when comparing screenshots. A change in viewport, device scale, output format, or page state can alter the image independently of a layout change. For CI artifacts, write screenshots to a known output directory and preserve them with the test results so a failed comparison is inspectable.
Rank #4
- 【Sturdy and Stable】: Made of premium aluminum alloy and stainless steel, Liphisy phone tripod with remote keeps your device stay securely in place for still shots and video recording.
- 【Multi-angle Shot】: With a max height of 64”, this tripod stand with a 210-degree rotation head and 360-degree rotation holder allows you to capture shots from any angle, catering to different photography needs.
- 【Wireless Remote Included】: Package includes a wireless remote that connects to your cell phone easily, making it a breeze to snap photos or video recordings.
- 【Height Adjustable】: The height of this cell phone tripod with remote can be adjusted from 17” to 64” and the easy lock mechanism makes it really easy to set up. It gives you an excellent vantage point for capturing photos and videos.
- 【Wide Application】: Compatable with different phone and camera, this tripod is great for photography and video recording, perfect for travel and home use.
Common problems and fixes
-
The browser executable is missing. The package may be installed but its matching browser binaries are not. Build the project and run the Playwright installation script for that output and package version.
-
The browser fails to launch on a CI worker or Linux host. Check the browser guide’s OS dependency and installation instructions for that environment, then install the dependencies required by the selected browser.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy. -
The site navigation times out or fails. Confirm the application is running and the URL is reachable from the process that launches Playwright. In containerized or remote CI environments, use an address accessible from that environment rather than assuming the host’s localhost is shared.
-
The selected device name is not found. The preset may not exist in the installed Playwright version. Inspect
playwright.Devicesand choose an available profile, or configure the needed dimensions and emulation settings explicitly. -
The screenshot shows missing or unfinished content. Wait for the page’s relevant selector or state before capture. Navigation completion alone may not mean the application has finished rendering the section you care about.
-
The image is unexpectedly large. Check whether full-page capture or device-pixel scale was selected. Use viewport capture or CSS-pixel scale if those fit the comparison or storage requirement.
PerformancePC Slower Than It Used to Be?DriversOutdated Drivers Are Slowing You DownPerformanceWindows Errors? Fix Them Before They SpreadSpecial offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.Best Value
SMALLRIG Universal Phone Holder Mount with Cold Shoe - 4382- Universal Phone Holder: This multifunctional phone clamp can be mounted on the top of a camera or tripod through 1/4"-20 threaded hole or cold shoe at the bottom for photography, live-streaming, vlogging, interviews, etc
- Support Landscape and Portrait Modes: The phone holder can be quick switching between landscape and portrait modes, and securely lock when rotated to 90° degrees. Two rotary joints supports 180 degrees adjustment
- Universal Compatibility: It supports smartphones with a width of 57-88mm / 2.5-3.5in (for Samsung, for iPhone 18 / 18 Pro / 18 Pro Max / 17 /17 Pro/17 Pro Max/16/16 Pro/16 Pro Max/15/15 Pro /15 Pro Max / for iPhone 14/14 Pro /14 Pro Max / for iPhone 13 /13 Pro /13 Pro Max / for iPhone 12 Pro Max and so on)
- Threaded Holes & Cold Shoe: Designed with well-spaced threaded holes to facilitate the installation of power bank holders (ID: 2336 / 2790). There is a cold shoe mount on top for microphone or light
- Package Included: phone holder x 1. Please note that the load capacity is 500g
-
A mobile screenshot passes but users still report phone-specific behavior. Emulation is not a physical-device test. Reproduce the issue on actual mobile hardware and the relevant browser when hardware or browser-specific behavior matters.
Or skip the browser setup
For a screenshot request without managing Playwright and browser binaries, ScreenshotNeo accepts one GET request with a URL and returns an image or PDF. Its clean-shot process accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the page verdict and billing status in headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents and other MCP clients. All features are available on every plan.
Here is the one-call cURL example, aimed at a mobile-friendly page URL. See the ScreenshotNeo API documentation for the API details.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo offers 1,000 screenshots per month free with no card; paid plans start at $5 for 3,000. ScreenshotNeo is a website screenshot API and MCP server made by Yorker Media. Sign up for the free plan to try it with 1,000 screenshots a month and no card.
FAQ
Does the screenshot code need to run inside the ASP.NET request pipeline?
No. The method described here is a separate Playwright .NET browser automation process that visits an accessible URL. That separation lets you run it as a console utility, test, or CI task rather than treating screenshot generation as a built-in ASP.NET response feature.
Does an emulated mobile capture prove the site works on an iPhone or Android phone?
No. It is useful for repeatable layout checks under emulated browser settings, but it does not run on phone hardware. Validate physical-device behavior on the actual device when that distinction matters.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

