I am building an ASP.NET MVC application that is AJAX-driven.
For some reason I need to add some DOM elements on the fly when clicking a submit button. This is accomplished with jQuery.append().
One element inserted is a textarea, whose the data must be parse before submitting to ensure that no cross-site scripting can be done.
We know that the Html.Encode() works great but must be declared outside a script tag. All I have done with jQuery is embedded within a script tag.
1) Is there a way to take advantage of the Html.Encode() within a script tag?
2) How can I accomplish this with jQuery?
At worst I can use HttpUtility.HtmlEncode(), which is called on the server-side.
Thanks for your help.
Roland
Hello,
I have an ASP.NET web application which was previously published using the Publish feature of VS2008.
Recently I switched to "Web Deployment Projects" for VS2008. When deploying I noticed that the ~/App_GlobalResources directory is not copied to the release folder on build anymore.
How can I make sure the App_GlobalResources directory is copied along?
I am using the jQuery sortable() feature to re-order a list of items. After an item is drug to a new location, I kick off an AJAX form post to the server to save the new order. How can I undo the sort (e.g. return the drug item to its original position in the list) if I receive an error message from the server?
Basically, I only want the re-order to "stick" if the server confirms that the changes were saved.
I want to develop a module to implement such a feature:
when exchange receive emails in the mailbox : [email protected]
the module will be triggered and modify the email's TO Address to /test/@smb.local and save back to mailbox [email protected].
Thanks in advance!
I have Javascript that imputes (computes and injects) HTML into my DOM for the Facebook "Like" function. I need to specify a "canonical" URL because the actual URL doesn't reflect all the DOM manipulations that have been made (driven by user activity on the Web "page"). Alas, Facebook's code doesn't use the url I supply but the window.location value (which has #hash aspects that influence the page's presentation, but that aren't accessible to the server). Anyway... why is FB's code ignoring the url I give to it?
I generate the HTML thus:
var html = '<iframe src="http://www.facebook.com/plugins/like.php?href=' + encodeURI(url) + '&layout=standard&show_faces=false&width=100&action=recommend&font=arial&colorscheme=light" style="border:none; overflow:hidden; width:270px; height:26px;" allowTransparency="true" frameborder="0" scrolling="no"</iframe'
Hi,
I am writing a chrome plugin in which I would like to receive events such as "load", "unload" of window and page. However, I'm not getting any concrete clue to start with.
Can anyone tell me how to capture DOM event in plugin?
Does Chrome support this feature?
Thank you.
I know how to mark a group of fields as primary key in ADO.NET entities but i haven't found a way to declare unique constraints or check constraints.
Is this feature missing on the designer or on the framework?
Thanx.
Hi there,
Recently I installed in Visual Studio 2010 the Power Tools Extension It's working great, however I have problems with my text coloring theme (Nightfall), and the extension's Colorized Parameter feature.
Since the theme text fore color is grey, when the Power Tools Extensions shows the Parameter Help tooltip using my text colors, it gets unreadable:
Is there a way to change Parameter Help background color?
I recently played with MongoDB in Rails using Mongoid. I like the ability to define attributes for models within the model file (as opposed to in migrations):
class Person
include Mongoid::Document
field :name, :type => String
field :birthday, :type => Date
end
For projects that cannot use a schema-less database, does a similar feature exist? Any gems or plugins that generate schemas from a similar syntax would be greatly appreciated.
Thanks.
I'm using WebSphere 6.1 with the EBJ3 Feature Pack installed. Does anyone know what jar I need to include in my project from the AppServer folder of my WebSphere installation in order to be able to use the @WebService annoation? I cannot seem to find it. Thanks.
Given what I know of every other type of static feature of programming––I would think the answer is 'no'. However, seeing statements like OuterClass.StaticNestedClass nestedObject = new OuterClass.StaticNestedClass(); makes me wonder.
Hi,
I am recently introduced to the test-driven approach to development by my mentor at work, and he encourages me to write an unit-test whenenver "it makes sense." I understand some benefits of having a throughout unit-test suite for both regression testing and refractoring, but I do wonder how often and how throughout we should write unit-test.
My mentor/development lead asks me to write a new unit test-case for a newly written control flow in a method that is already being tested by the exsisting test class, and I think it is an overkill. How often do you write your unit tests, and how detailed do you think your unit tests should be? Thanks!
What is a good method to align images together that may have different rotations, exposures, etc, but have the same background or other fixed reference?
Adobe Photoshop can do this with its "Photomerge" feature.
How can I do this programatically? Is there an Open Source application that does it?
Hi,
I've implemented unit testing along the lines of this article with a fake object context and IObjectSet with POCO in EF4.
http://blogs.msdn.com/adonet/archive/2009/12/17/test-driven-development-walkthrough-with-the-entity-framework-4-0.aspx
But I'm unsure how to implement a couple of methods on my fake object context for testing. I have CreateQuery and ExecuteFunction methods on my object context interface so that I can execute ESQL and Stored Procedures but I cant (easily) implement them in my fake object context.
An alternative would be to use a test double of my repository instead of a double of my object context as suggested here:
http://social.msdn.microsoft.com/Forums/en-US/adonetefx/thread/c4921443-e8a3-4414-92dd-eba1480a07ad/
But this would mean my real repository isnt being tested and would seem to just bypass the issue.
Can anyone offer any recommendations?
Does anyone know with what I can draw a unfilled square on a live video stream/saved video in C#.net?
Someone said to use Directshow but it is for C++ users. Is there a feature in dshownet that addresses this issue ?
Another said to use XNA, but my project is a object tracking application.
Eclipse Vaadin plugin has cool autobuild feature. Just clicking "restart application" in debug console will bring up to date application version to live.
Unfortunately importing maven generated vaadin project(using m2e) and copy-pasting .project buildCommands and natures from vaadin eclipse plugin generated project does not works.
I'm unnable to "Run on server...", tomcat does not deploy app for unknown reason. I can see app in wtpapps folder but it still does not deploys.
I'm trying to link 10 computers together, the program i would like to write would have one 'control' computer. From what I've looked up this computer would take all the packets sent over the network and do a echo with them... right? The other computers would need to be able to send information (then echoed to the others) to the 'control' ... is there a easy! or simple way to do this? From what I've seen i want a non-blocking socket?
I have looked into sockets and such but for an armature programmer like me, this seems like a daunting task :)
I'm kind-of looking for an easy class implication that has a send() and an event driven recv().
I'm not going to be sending that much information over the network.
This Eclipse bug mentions something called CTabFolderPageManager, which seems like it could be useful for me. However, searching for CTabFolderPageManager doesn't give any results. Is it a future feature for SWT (given that the bug report is from 2007, this would be surprising)? Or did I just fail at searching for it?
is this OK to on the firewall on windows 2003 Domain & DHCP server?
if yes then which ports should be passed from firewall to use full feature of
Active directory domain controller
file & Printer Sharing
DHCP & Dns
thanks
Hi,
I notice when you go to google.com for example, the input field keyboard has a "submit" button as opposed to the original "return" button.
How do I turn on that feature?
I tried type=search but I still see the return button.
Thanks,
Tee
Just had a discussion at work about the merits of using PostgreSQL over MySQL and vice-versa. Does anyone have any practical experience where there is a valid reason to use one over the other?
Some people were saying that Postgre is better for security purposes whereas MySQL is becoming more feature rich... I'm not sure what to make of it.
Hi,
I have started out with macvim and now fairly comfortable with the navigation (on a single file) and now I need to write a whole project (say rails) using mvim.
In textmate, you have mate project_dir which opens the project in a side drawer, so my question is:
Is there a similar feature in mvim?
How can a complete project managed in traditionally in macvim?
Links to some write-ups are welcomed.
I have a wordpress site that i've been working on that has some pages (as in NOT posts) that a client changes content on in order to target particular keywords. these pages have been using podscms for content management.
The client now wants to be able to duplicate these pages any number of times and edit the text within them. So basically, he wants to be have a dozen or so versions of about 4 linked pages.
Does anyone know if it's possible to duplicate an entire multipage structure like this in WP?
Or any WP driven sites that implement segmentation similarly?