It's a client side function. Look at DHTML document.selection object. You
can get the selected text on the client and communicate it to the server in
a hidden text input.
I've already used the DTE object and have coded the following lines into a
button click event:
' Get an instance of the currently running Visual Studio .NET IDE.
Dim dte As New EnvDTE.DTE
dte =
System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE")
'Get selected text
Dim objSel As TextSelection = dte.ActiveDocument.Selection
lblTest.Text = objSel.Text
however, i am getting the following error:
Exception Details: System.Runtime.InteropServices.COMException: COM object
with CLSID {3C9CFE1E-389F-4118-9FAD-365385190329} is either not valid or not
registered.
You are talking about Visual Studio text editor. Here we discuss ASP.NET and
I thought you were talking about selected text in an html control. You
should ask in a relevant newsgroup.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.