Home All Groups Group Topic Archive Search About

highlight text and right click on it for a custom context menu



Author
22 Mar 2006 9:55 PM
Abdalla
Dear All

I have a project on making a UI of a Web page that allows users to:
1. select any text by highlighting it, and
2. do some action on it by right-clicking on the highlighted text and choose
an action among those options presented by the context menu items that
appears.
3. send the chosen action along with the text and its attributes to the
server as the user clicks on the desired menu item.

Interestingly, the next stage is to make the menu items customised by the
type of the selected text, e.g. a link or an ordinary body text.

Does anyone know if all these can be done fully using ASP.Net at the server
side?
Could anyone help, please?

Many thanks in advance.

Author
23 Mar 2006 2:27 PM
Bob Barrows [MVP]
Abdalla wrote:
Show quote
> Dear All
>
> I have a project on making a UI of a Web page that allows users to:
> 1. select any text by highlighting it, and
> 2. do some action on it by right-clicking on the highlighted text and
> choose an action among those options presented by the context menu
> items that appears.
> 3. send the chosen action along with the text and its attributes to
> the server as the user clicks on the desired menu item.
>
> Interestingly, the next stage is to make the menu items customised by
> the type of the selected text, e.g. a link or an ordinary body text.
>
> Does anyone know if all these can be done fully using ASP.Net at the
> server side?

No. Server-side code can only respond to form submissions. It cannot respond
to client events unless client-side script causes a postback to occur. In
this case a postback may be a less-than-ideal experience for the user. You
might want to look into AJAX (google for this term). In any case, you will
probably get more help in a client-side scripting or dhtml newsgroup

> Could anyone help, please?

There was no way for you to know it, but this is a classic asp newsgroup.
While you may be lucky enough to find a dotnet-savvy person  here who can
answer your question, you can eliminate the luck factor by posting your
question to a newsgroup where the dotnet-savvy people hang out. I suggest
microsoft.public.dotnet.framework.aspnet.

HTH,
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

AddThis Social Bookmark Button