Can Anybody help me out in setting webbrowser control project on localhost(Virtual directory ) . i am successful in using webbrowser control on web application but it runs on file system or web application with some specific port defined. how can i use by configuring it on virtual directory without any port .
Thankx in Advance

Dani AI

Generated

Short practical checklist for serving a web app at http://localhost/virtualdir so the WinForms WebBrowser control does not show a port number. The Visual Studio development server (and by default IIS Express) assigns a port for debug sessions. To get rid of the port, host the site in full IIS (bound to port 80) or publish to an IIS application that uses a host header on port 80.

Steps (summary):

  • Enable IIS on Windows and open IIS Manager. Add a virtual directory or add the folder as an application under a site (Default Web Site is fine). Point the physical path to the published output or the project folder.
  • Configure the application pool (.NET CLR version, 32-bit setting if required) and give the app pool identity read/write access to the physical folder.
  • In Visual Studio Project > Properties > Web, switch to “Use Local IIS Web server”, set the Project URL to http://localhost/YourAlias, then click Create Virtual Directory (admin rights required) or publish directly to the IIS physical path.
  • For debugging, run Visual Studio as Administrator or attach the debugger to w3wp.exe. Ensure <compilation debug="true"> while troubleshooting.

Troubleshooting notes:

  • 404 = wrong alias/path; 401/403 = permissions or authentication; 500 = check IIS logs and Event Viewer.
  • If a page renders differently inside the WebBrowser control than in IE, check IE emulation settings for the host process (document mode differences).
    For : this is the recommended path to get a clean http://localhost/virtualdir URL. As hinted, DOM interaction is still available once the app is hosted; is correct to ask unrelated questions to be posted separately.

Recommended Answers

All 2 Replies

mKashif what are you doing here? Start your own thread.
ansari.wajid :
A webbrowsercontrol has a Document property which is a htmlDocument which has a Back- and ForegroundColor property. Hope this helps.

Dont hijack someone else thread with a almost non similar question just coz it has the word "web" in it.

Start your own.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.