The only example of a simple script# jQuery plugin I could find online is here:
http://groups.google.com/group/scriptsharp_coding/browse_thread/thread/40769da17b0bb8d2?pli=1
The JQuery object from ScriptSharp 0.7.3 does not appear to expose a fn property or method though, so I am not sure how to continue.
Has anyone done this before, and could possibly give me a few tips?
Ok sorry for the initial trivial search. This page nicely explains how to do a jq plugin with script#:
http://michaelmurray75.wordpress.com/2011/07/16/getting-started-with-jquery-plugins-with-mvc-and-script/
You can get the whole code here
Related
I need to change some styling on my webpage based on if it's being called from one website it's embedded in vs the other (as an iframe). I looked up a bunch of stuff about it; uri, requests, httprequests, using the "object sender", but nothing seemed to show any differences. I am trying to do this inside the "Site.Master.cs" in asp.net. Any help or tips are appreciated, thanks!
I think what you're looking for is HttpContext.Request object. Has lots of properties about the requestor,
specifically HttpContext.Request.UrlReferrer,HttpContext.Request.UserAgent, HttpContext.Request.UserHostAddress and HttpContext.Request.UserHostName
Check out the docs
I'm trying to implement a drag-n-drop fileupload to my website and found a piece of java called Dropzone.js, it holds everything i need . . . i just have no idea of how to use it!
So far I've been programming only in razor ASP.NET (c#) / HTML / CSS, but so far no javascript / jquery.
It's razor webpages, so no mvc.
Due to my current lack of knowledge in java, i apologize in advance but i'm stuck !!
What i'd like to know is:
I'f i've understood things correct, i should not modify Dropzone.js directly, i should use it as a library and integrate it in my other scripts, e.g. in another .js file. Correct?
Any help in this will be greatly appreciated.
Kind regards,
Daniel A. Rischel
.. Edited as per requested.
Well, you're wrong somewhat. It might not be related to the question but please note these scripts are JavaScript and
java != javascript
Got the point? :) Please try to note this in future. Also, Java code cannot be added to these server-side language, because java itself is a language. You can use JavaScript or its library (jQuery) and create some plugins.
I'f i've understood things correct, i should not modify Dropzone.js directly, i should use it as a library and integrate it in my other scripts, e.g. in another .js file. Correct?
True, you need to link this plugin dropzone.js to the site using
<script href="/link/to/dropzone.js"></script>
Then you'll use this script on the whole of the page where it is linked.
And you should never edit the source code of a plugin, untill or unless you know what you're doing. Because you might mess up with the code.
I'd really like to see some source code examples of what a single file drag-n-drop fileupload form would look like. I've googled extensively but not found something i can use yet.
Did you try to read their documentations? They have a good code explaination on the default (main) page of their website too. And really it depends on just the way you style it. Its just a plugin, you will need to add your own CSS code to style the form. This plugin won't style the form for you, all it will do is to handle the upload events and get back with the result. So, which means that form creation and elements is all upto you!
If there is a dummies tutorial in making this work, i'd really like to be pointed in the right direction!
There is no perfect answer to provide you with, however I will provide you with some basics
http://www.javascriptoo.com/dropzone-js
https://stackoverflow.com/questions/tagged/dropzone.js?sort=newest&pageSize=15 (stackoverflow tag)
In the second link, you can go and see what are the very basic of the issues that are handled with what code. Easy methods will be hanlded by you! You'll need some guidance in just the hard jobs. Good luck for that!
My suggestion for you is to first undertand and learn jQuery, then learn how to make ajax calls. After that you'll know how to create and handle the events. The basic code will be
$('input[type=file]').change(function () { // change in value
// send the file via ajax
}
http://jquery.com
This method will be best as you will know what code you're using and what it will do. Using plugin is easy method then this one. But my preference is with the second one; creating your own plugin.
HI I am pretty new in C# sphere. Been in php and JavaScript since the beginning of this year. I want to scrap posts and comments from a blog. The site is http://www.somewhereinblog.net
What I want to do is
1. I want to log in using a software
2. Then download the html
3. Then use regular expressions, xpath whatever comes handy to separate the contents of posts and comments
I been searching all over. Understood very little. Though I am quite sure I need to use 'htmlagilitypack'. I dont know how to add a library to c# console or form application. Can someone give me some help? I badly need this. And I am not too into C# just a week. So would be grateful if there is some detailed information. Waiting eagerly.
Thanks in advance brothers.
Using Webclient you can login and download
Instead html-agility-pack I like CsQuery because lets you use jQuery syntax inside a string in C# code, so you can download to a string the html, and search and do things in it like with jQuery and HTML page.
I'd like to add some kind of simple URL resolution and formatting to my C# and jQuery-based ASP.NET web application. I currently allow users to add simple text-based descriptions to items and leave simple comments ('simple' as in I only allow plain text).
What I need to support is the ability for a user to enter something like:
Check out this cool link: http://www.really-cool-site.com
...and have the URL above properly resolved as a link and automagically turned into a clickable link...kinda like the way the editor in StackOverflow works. Except that we don't want to support BBCode or any of its variants. The user experience would actually be more like the way Facebook resolves user-generated URL's.
What are some jQuery + C# solutions I should consider?
There's another question with a solution that might help you. It uses a regex in pure JS.
Personally though, I would do it server-side when the user submits it. That way, you only need to do it once, rather than every time you display that text. You could use a similar regex in C#.
I ended up using server-side C# code to do the linkification. I use an AJAX-jQuery wrapper to call into a PageMethod that does the work.
The PageMethod both linkifies and sanitizes the user-supplied string, then returns the result.
I use the Microsoft Anti-Cross Site Scripting Library (AntiXSS) to sanitize:
http://www.microsoft.com/download/en/details.aspx?id=5242
And I use C# code I found here and there to resolve and shorten links using good olde string parsing and regular expressions.
My method is not as cool as the way FaceBook does it in real time, but at least now my users can add links to their descriptions and comments.
I am trying to add a rich text editor in my web page where users can write reviews and format what they have written...something similar to the editor in which we write our posts on this site...
can anyone point me to the right direction regarding this...any tutorial that would help me build such a component...
Also i want a free product....(Forgot to mention earlier...)
Something in the likes of TinyMCE or FCKeditor, perhaps.
They're quite complete, and customisable.
The editor used on Stack Overflow is the WMD Editor.
The current version used on the site has been updated by Jeff Attwood and other site users and you can read about it here and get a copy of the code for your own site.
I think you'd be better off using (and perhaps modifying) an existing component rather than writing your own from scratch.
I've been using the Telerik r.a.d Editor, and been very happy with it.
after much research here is what i did...
i needed a control that was free and easy to use..all the editors that i went through came with a licence so i decided to make my own control!!!!
well..i couldnt do that on my own so i used the help of a few sites....
javascript Rich Text Editors
http://aspalliance.com/1092_Rich_Text_Editor_Part_I
http://ws.aspalliance.com/1092_Rich_Text_Editor_Part_II and a few others too...
so the best option for me was to build my own control so that i could customize it according to my needs....
http://freetextbox.com/
here is yet another one: NicEdit