Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello,

Please is there anyway that if a user type link in textbox then webbrowser will show/open the link automatically???
Posted

1 solution

Of course it could be done (isn't it obvious? using JavaScript…) but makes little to no sense. Suppose you type the link "http://www.mySiteDomain.com/page.htm". As this is a valid link, your code can detect it and initialize the action, sends HTTP request there. But what is that the use meant to write a bit different HTML, with one extra character "http://www.mySiteDomain.com/page.html" (+'l' at the end)? Both URLs have valid forms, but one of them could be of some really existing page, and another one not. And what to do with URL pointing just to the directory of the root of the site, and the index file will be loaded in HTTP response, as per the site or its directory setting? And what about URL rewrite engine and other server-site techniques interpreting URL in requests? No, you cannot recognize the moment of time when the link is finished to type.

And it makes no practical sense, because the user would not appreciate even it was possible. You always need some event to start loading/redirecting, at least the hit on Enter.

So, if you need to know the techniques capturing user input in an HTML control on each entered character, I can tell you, but I don't really want to waste time on it, because you first need to realize how to design your UI in some non-nonsense way.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900