This is actually the same code that I used for the BlogEngine.Net extension that I created a while back. However I needed it to be a bit more generic (not BlogEngine specific) and take the code from a text box so I ended up creating an AJAX extender:
CopyToClipboardExtender.zip (2.07 kb)
It's rather basic. The targetID is the link you want them to click on to copy the text. The CopyID is the text box's ID. It most likely will not work in Firefox, etc. and is really only IE specific. However it's better than nothing.
As far as setting it up, sometimes I get a bit lazy when it comes to explaining how to use some of the code on here. In the case of the AJAX controls, I usually leave out the fact that you need to download the AJAX Control Toolkit. Once you have that and you've added the templates, etc. like it says in the setup, you need to create an ASP.Net AJAX Control Project (I've used the name of AJAXControls, so if you use something different you'll need to potentially change some of the code to point to the correct namespace). From there, you add the code (making sure to have the js file as an embedded resource). Compile and you're ready to go...
Now that jQuery is going to be the norm, the setup process will probably change in the future. Plus I plan on packaging these up at some point like the utilities. For now though I leave you with the code. So try it out, leave feedback, and happy coding.
Be the first to rate this post - Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5
I just want to say up front that I'm not a big fan of formats like this and I'll get into why in a bit but I had to create a simple parser so I decided to share the code. Anyway, FOAF (otherwise known as Friend of a Friend) is a very basic, machine readable markup using RDF/XML to describe people, whom they are friends with, groups they're in, etc. In theory it could be used to allow social networks connect to people outside of their network, connect IM clients, connect... well... anything where a person's basic information is needed. Thankfully you can start using the format immediately:
FOAF.zip (4.15 kb)
And yes, it has the MIT license at the top (which means it's going in my utility library). Anyway, it's commented and it does work for basic items. However, I didn't implement certain items, such as IM client IDs, blog pages, etc. (nor the DNA checksum...) But it does the basic phone number, email address, name, people known, etc. It also works with the FOAF-a-matic. So if you created a document using that, it will read it.
Now before you get all happy with it and think that you're going to create a social networking site and it will talk to everyone... I've yet to see it used by a large enough groups of sites to make it worth while. You add in the fact that the format is mostly designed for machines only (unlike hCard and XFN), and that there are more widely used concepts like OpenID, and you end up with a format that is OK but you can live without it. I mean Google's Social Graph API works with the format (which is why I created the parser), but it also works with XFN, and XFN can be stylized using CSS, embedded in a web page, etc. And like I said, you have hCards which are gaining momentum, so I just don't see the need yet for FOAF... Never know though as it might catch on more and more as time goes on (I mean I remember a time when people said that XML wasn't going anywhere). Anyway, try out the code, leave feedback, and happy coding.
Be the first to rate this post - Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5
You know, setting up an intranet to use windows authentication SHOULD be easy. And actually it is, you just set authentication="windows", impersonation to true, set up the browsers correctly so that they see the server as part of the intranet so it will automatically send the credentials (and God help you if you're using IE and the settings get corrupted. You'll have to reset everything to the factory defaults.), etc. It gets a bit more complicated though when you want to set up your intranet site such that people can access their exchange/outlook accounts. At that point you need to set up Kerberos on your intranet.
I'm not going to go over how to do that since this article describes it fairly well. There are a few things that you'll need to do if you're using a newer version of IIS though (namely set it up for constrained delegation, which just requires picking that option, finding your exchange server, and picking http from the list of services if you're going to be doing WebDAV calls against it). But to be honest, that's all there is to it... Well you might also need to set up the SPN for the intranet server properly (HOST/server name that people use to get to it). Because if that isn't set up, then the browser wont trust the server and it wont send the info... But that's about it.
Anyway, once you get past all of that you may want to do some simple queries against the Exchange server that you just spent a couple hours getting set up... And if you're using the code that I provide on my site (or potentially your own), most likely you'll run into an issue. Mainly the code I have (and that is used most often out there) wasn't set up for windows authentication (it assumed that you knew the user name and password). However there is an easy fix. The network credential cache needs to have a couple entries switched:
System.Net.CredentialCache MyCredentialCache = new System.Net.CredentialCache();
MyCredentialCache.Add(new System.Uri(uri)
"Negotiate",
(System.Net.NetworkCredential)CredentialCache.DefaultCredentials);
You'll notice two changes the second item when we're adding to the credential cache is normally NTLM. We've switched it to Negotiate (basically telling the system that we're going to be using Kerberos). The third item in the add function is no longer a new networkcredential object containing our user name and password. Instead it uses the default credentials. The reason for this is fairly simple. The DefaultCredentials contains the current user's information. That's all that needs to change in our bit of code. So hopefully this little bit of code will help someone out as it took me a bit to track down what my issue was (I didn't change from NTLM to Negotiate)...
Also, in other news I've moved my utility library over to CodePlex. I also ended up adding a few bits of code, including classes to help with:
-
Serialization
-
File management
-
HTML, added functions to dump request/response variables
-
XMDP
-
OPML
-
Active Directory queries
-
Exchange queries
-
iCalendar/Appointment management in Exchange
-
APML
-
hCalendar
-
hCard
Plus a couple of other bits here and there. I'm also trying to improve the structure a bit and try to make things a bit more logical. So hopefully it will help someone out. Anyway, try it out, leave feedback, and happy coding.
Be the first to rate this post - Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5
|
|