I'm developing an application in C# using visual web developer. I'm displaying some text for reading and I want the user to be able to select a word or fragment, and then right click it to display a customized menu (One that has for example define, search, show grammar...). I
I don't know how to do it. I'm fairly new to the .Net
Thanks!
You have to do that entirely on the client-side, in JavaScript.
Note that it's considered a bad idea to take over right-click, which the user has the right to expect will work the same no matter which application they are using.
Related
I just started learning asp.net, I want to put a textbox in my gridview control to let the user input whichever page the user wanna go instead of click First/Prev/Next/Last buttons.
Within the gridview control pagersetting mode, I can't find an option to create this kind of function. Is there a way to do this in ASP.net?
Start Visual Studio -> File -> New Project -> Web -> ASP.NET Dynamic Data Entities WebApplication
In solution explorer expand Dynamic Data -> Content folder
There is an awesome user control called GridViewPager.ascx:
Add it to your project and specify it as the PagerTemplate in the GridView:
<PagerTemplate>
<asp:GridViewPager runat="server" />
</PagerTemplate>
You may need to tweak the user control slightly to work for your specific project but this should give you a good start
Its called paging. This will show you how to implement paging. I know its not ASP.NET but the C# code the methods are the same. As they explain you need to use a data adapter to create the pages the viewer will see.
Hope this helps you!
I am working on an ASP.NET/C# application,
I am looking for the best way to do the following. (Note: I don't need you to tell me how to do it, just if you can point me to the right direction to look)
in my main page I have a button. When the user clicks it,I want to open popup open containing a map. the user can click on counties to highlight them and then click on submit. I want to be able to know which countries the user has clicked on in my main page (maybe save it in a array or string or anything)
What is the best way to do this? Should I use flash?
I know this is not a problem/solution type of question, but if someone can point me in the right direction I would very much appreciate it. Just some ideas and I will do the researches.
Thank you very much for any inputs or comments
And sorry for not being a specific problem question.
For the pop-up you can use a dialog (a "modal" HTML form like what you find in jQuery UI or similar). If you're using plain "old" ASP.NET you may need some trick if you want to use forms but they works well.
If what you want to provide is a selection from a map you do not need Flash (at least I wouldn't use it for such simple task, I'm not a fun of that kind of extensions). An image map can work well and it's more portable. If you want you may use HTML5 features to provide better experience for users with a compatible browser. I do not remember the link but I saw a very nice example of this using plain HTML (4) and JavaScript. Using a low-res image as base for the map, small images as checks applied on top of it and div tooltips for details (it supported a zoom-on-click feature too to enlarge a portion of the map loading a higher resolution version). I guess I wrote somewhere that URL...
Links
Nice article: http://www.workwithchoicecuts.com/methodology/revisiting-the-html-image-map/
For image maps basics: http://www.javascriptkit.com/howto/imagemap.shtml
Image map builder: http://www.image-maps.com/
jQuery plug-in for selection from maps: https://github.com/jquery/plugins.jquery.com
I am quite new to SharePoint and have been given an interesting problem to solve. My users have requested to each have a custom home page that they can customise with ease. The design I have been given is to have an almost blank page with space for 4 webparts organised in a 2 by 2 fashion (2 webparts by 2 webparts) each with a big '+' button in witch to click to select and add a widget of their choosing without having to play around with the ribbon. This is expected to look something like this:
http://imageshack.us/photo/my-images/841/homepages.jpg/
Now when a user clicks a '+' a SharePoint dialog is to be displayed allowing the user to choose from all available web parts. On selecting one the home page is refreshed and the widget is displayed in the selected zone.
I am currently trying to de-risk this request to see if it is possible to achieve in the time frame given. The problems I have at the moment are as follows:
Programmatically getting a list of all available webparts to display in the dialog.
On the selection of the webpart programmatically adding that chosen webpart to the correct part of the home page without hard coding the type of webpart (so the code does not need to be changed when a new webpart is added to SharePoint for users to add).
I would really appreciate any help or advice on this. Thanks in advance and sorry if the question is well phrased, this is my first Stack Overflow question!
Just create a webpart that does that.
Render a big plus sign and when a user clicks there, the event handler gets all webparts available and renders it to a dropdownlist for instance. The rest is easy, when a user selects one, get it (by guid/name whatever) and add it to the zone where the first webpart was present, not forgetting to remove the plus sign webpart from the clicked webpart zone first.
This can be achieved using the SPLimitedWebPartManager.
The tricky part could be the Webparts that are available on the SiteCollection, but you could research on that.
Regards,
Pedro
I am developing a winform app which is controlling a website. On click of a button in winform app i want to fill a form, click the submit button on the web page upon which a new page will open , on that page i have to click on a link.
How to achieve this. i have tried many things but did not got any proper solution
If you're looking for a web automation tool, use Watin. It allows you to automate via code the opening of a browser, the clicking of buttons, and the fillout of form fields. However, that is more of a testing library.
Honestly though, your choice of solution sounds odd. You're trying to get a client application to make requests through a web page, instead of directly requesting whatever resource yourself from the client application. It's hard to give you a direct solution without a good understanding of the problem space.
I would like to setup Feedback link on every windows form, so that user can send suggestion about design, functionality etc.. using C# (.NET 3.5) but I could not find solution.
Any help or suggestion will be appreciated.
On every form? You could create a "FeedbackLink" UserControl, and place that whereever you like. I wouldn't recommend trying to do it as a clever blanket-thing, because you can never assume the place you want the feedback hyperlink won't be used by something else.
My suggestion would actually be to add it to the "Help" menu on your main form, and possibly in some kind of (very intrusive) pop-up dialog. Maybe do it the way Visual Studio tackles it - by putting an icon in the systray with a bubble that pops up for the user to click on?
Example image (might take a second or two to appear):
Example http://www.freeimagehosting.net/uploads/b7939d58ae.png