The page's model has a string property called instructions which is displayed in a textarea, and whether adding or editing the object, a line break is inserted for no reason that I can find.
Html.TextAreaFor(m => m.Instructions) is the only relevant code. In Chrome and Firefox a line break appears in the text area, but not in internet explorer.
I'm at quite a loss here.
After searching around some more I found out that this has to do with the AntiXssLibrary.
There's more information here
http://forums.asp.net/t/1693760.aspx/1
From reading this, it sounds like it's been fixed in MVC 4
http://aspnet.codeplex.com/workitem/8848
If you're using the AntiXssLibrary and MVC3 you'll have to manually strip the line breaks with javascript.
Related
I am upgrading the objects on my form to DevExpress tools as opposed to the standard WinForm tools.
I am working with a field that contains hyperlinks only, I originally tried to use a MemoEdit but found out after googling that it wasn’t possible to use hyperlinks in this type of field. I seen the RichEditControl get mentioned in a few places but it seems to open a whole control and I’m just trying to make text in a certain field a hyperlink.
So I’ve ended up at the HyperLinkEdit field and it’s working as hoped apart from the fact that the text isn’t wrapped/multi line, meaning that the text just carries on as a single line so on the larger file paths the characters are hidden after a certain length due to it not wrapping and starting a new line.
Could anyone provide a pointer for this? I checked the properties and nothing has jumped out to me and the fact that there’s no multi line property makes me think there isn’t a way to do this using this type of field.
Edit:
I'm trying to implement a cache clearing button for our website that will append the Clear-Site-Data header on a specific route so we can be relatively sure that the users are getting the latest javascript, css, etc. after a release. I'm assigning the header in my ActionMethod like so:
According to developer tools, I'm getting the header on the client:
So, Chrome is trying to do what I'm asking but it's throwing an error saying the types I'm passing it are unrecognized:
Am I missing something with how I'm creating the header? Is this a bug?
Ok, so here we are a few months down the road and I finally remembered to come back and post the working solution. What I didn't understand at the time I asked the question was that the quotes are expected to be treated as literal in the response header examples I found. So the code I posted in my question was missing a few \ characters in the strings. What ended up working was this:
The headers on the client now look like this (note the quotes around cache and storage):
And the cache and localStorage are cleared as desired. Hope this helps someone else as well!
I have a results page only working in IE. It is developed using C# and js in visual studio. So I select a search parameter from the drop down list and search. The results from the DB are displayed in a results page. Those results seem to only be displayed when I use IE. Chrome and fireFox allow for everything else to work except the results:/
Any ideas what could be occurring? Something i need to check with my web.config perhaps?
Thank you in advance=)
C
This is likely an html issue and unrelated to ASP.NET. You should examine the generated HTML. It will be especially easy to see if the data is in the DOM by using Chrome and Firebug.
In Chrome (since it's a place where it's not working) bring up the page and press CTRL+SHIFT+I - this will bring up the DEVELOPER TOOLS. Once up, attempt to use the page and watch the CONSOLE tab of the developer tools. You most likely have scripting errors and the Console will point them out. Many times, you can even click on the console-report to go directly to the offending code (but sometimes you cannot). Regardless, the developer console should help you find the trouble.
If it's a CSS issue, the first tab will be the most helpful to you instead - you can find the generated code in HTML and click on it, then all CSS styles will be on the right and you can review them (and even change them if you need to for testing purposes) to find and eliminate trouble items.
I am trying to access movie info using themoviedb API as imdb seems like a lost cause.
They use a key which I replaced with *'s but from what I can see this should be all I need to do a simple search
so my code is very simple
TmdbAPI api = new TmdbAPI("***************************");
TmdbMovie[] movies = api.MovieSearch(batman);
But whenever I search I get the XMLParseException unless I outcomment the second line
There is a sample application, but I cant get it to run with VS2010 and I cant see how its doing the things any differently except that app reads the name of the movie from a textbox as mine will further down the road.
Looking at the issue tracker, there appears to be a problem with the returned XML since December 1st 2010 (if not earlier).
In C#, I'm sending a mail with an activation link to users after they have registered. However, the link is split over two lines in the mail and thus doesn't work.
I've checked in Visual Studio and the string containing the link looks fine.
I've also tried:
strMessage.Replace("\r", "");
strMessage.Replace("\n", "");
but without success.
Do you have any ideas on how to solve this? I've googled it for hours and can't find the solution...
Thanks!
/J
Is the link longer than 78 chars? Or is there some other text in front of it?
If so, see if you can make it less than 78 and I don't think it'll wrap it. Otherwise, I seem to remember that this could be sort of fixed in some email applications by changing the encoding, possibly the same might work here since I see that there are various Encoding properties of MailMessage.
If you are sending the message as an HTML email, then you could put a link around the email so that it renders on one line, and then have the actual link in brackets with instructions on how to copy and paste it ensuring it's on one line.
Register here
(if the above does not appear in a link, copy the following link into your
browser ensuring that it all goes on one line:
http://www.longaddresshere.com/thatkeepswrapping)
I finally managed to solve this annoying problem. It seems like Outlook was the cause of everything, it divided my LONG html string into two lines. My link just happened to be right at the point of the line break. So I added the sufficient number of characters (with the same color as the background) to make my link start on the second line.
Not the best solution, but it worked in this case...