Plus sign converts to + in nopcommerce 41 but resolve into 42beta - c#

My website is build with nopcommerce41. '+' characters are being replaced with &#x2B on runtime.
Everything is working fine except for this issue.
Example: Google search results displays url look like www.demo.com?search=+apple but bing search engine display this same url look like www.demo.com?search=+apple.
If user comes from bing search engine then user can't find expected result.
now I have compared the code of both versions of nopcommerce41 and nopcommerce42beta and result is as shown below:
view-source:http://nop42beta-001-site1.ftempurl.com/ (this site into 4.2beta)
e.g. <li class=facebook><a href=//www.facebook.com/+nopCommerce target=_blank>Facebook</a>
view-source:http://demo.nopcommerce.com/ (this site into 4.1)
e.g. Google+
nopcommerce team already fixed this issue into nopcommrce 4.2beta but I dont want to upgrade my project. Can any one help me solve this issue?
This issue already reported into development section but this is a problematic bug so I have posted here.
https://www.nopcommerce.com/boards/t/62489/plus-sign-converts-to-x2b-in-nopcommerce-versions-running-on-net-core.aspx
one example to understand this issue
one more example as below:-
In a Index.chtml file i have write code
#{
Layout = null;
var test1 = "/+apple";
}
Sangeet1
Sangeet2
now i have run project then i got result as below
view-source:http://localhost:15543/
Sangeet1
Sangeet2
second dynamic string + symbol convert into +(Unicode Hex Character Code) but first static value not converted.

nocommerce is open source, you can find the changeset that fixes your issue and build a 4.1 version with this specific fix

Related

Parse string with wiki markdown and show like in browser

Hopefully you can help me as I do not find a solution neither on the web nor in my brain.
I am querying a issue-tracking-system (jira) via a webrequest. The systems answer is a json-file with a description of an issue represented by a string that has wiki-markdowns in it. It is possible to show this string 1:1 to the user. But I would prefer a solution to somehow parse the string and show the user not the textual markdown but the parsed elements like tables or numbered enumerations.
I use C# and currently I am showing the information in a richtextbox, but I guess richtextbox is not the element you choose for such a requirement.
For Example the following string is returned by the jira-system and I would like it to be shown as a "real" table and an enumeration to the user.
||criteria||status||
|concept 1|open|
|concept 2|open|
* topic 1
* topic 2
Hope you can help me
after long researches the answer is totally simple.
The Jira offers a conversion from markdown to html itself. When you query an issue via a URL just add ?expand=renderedFields to the URL like explained here https://community.atlassian.com/t5/Answers-Developer-Questions/How-can-I-get-the-rendered-HTML-of-a-wiki-markup-field-in-JIRA/qaq-p/495779
You will receive the answer like before and additional to that the html-writing of the answer. With that answer it is almost simple to show it in an webbrowser-element in the UI

ajax auto complete extender results as strings

i have run into an interesting issue...
i am using ASP and auto-complete extender on a textbox
i got everything working but i was getting very odd results.
when searching for something like 315122-111 the only result that would come up was 315011.
this is because the item-number is being treated like a number instead of a string
315122-111=315011
i am sending everything as a string.. when i use fiddler to view the traffic all the auto-complete responses coming in 315122-111 they are just not being properly...
any ideas on how to fix this dilemma?
Is there an eval() being called on the javascript side?
http://www.w3schools.com/jsref/jsref_eval.asp
There's a bug that was fixed in this post:
http://forums.asp.net/t/1164200.aspx?New+AutoCompleteExtender+doesn+t+work+with+Numeric+Values
They stated:
1. download the ajax control toolkit source. open the file
2. AjaxControlToolkit\AutoComplete\AutoCompleteBehavior.js at line 748,
3. you should see: "if (String.isInstanceOfType(pair)) {"
That line is what is causing the problem.... to fix it, I changed that line to "if (String.isInstanceOfType(pair) || Int.isInstanceOfType(pair)) {".

C# Unknown Text Found

I'm creating a program to transfer text from a word document to a database. During some testing I came across some text inside a textbox after setting it's text to a table cell range as follows:
textBox1.Text = oDoc.Tables[1].Cell(1, 3).Range.Text;
What appeared in the form was:
What wasn't expected was the dot at the end of the text and I have no idea what it is supposed to represent. The dot can be highlighted but if you try and copy and paste it nothing appears. You can delete the dot manually. Can anyone help me identify what this is?
The identification bit shouldn't be too hard:
string text = oDoc.Tables[1].Cell(1, 3).Range.Text;
textBox1.Text = ((int) text[4]).ToString("x4");
That will give you the Unicode UTF-16 code unit for that character... you can then find out what it is on the Unicode web site. (I usually look at the Charts page or the directory of PDFs and guess which chart it will be in based on the numbering - it's not ideal, and there are probably better ways, but it's always worked well enough for me...)
Of course when you've identified it you'll still need to work out what the heck it's doing there... does the original Word document just have "HOLD"?

ASP.NET 4.0 Changes Control Rendering so that RegEx to Parse ASP.NET Rendered HTML No Longer Works

When trying to find a href tags to update them on the fly in html held in a string, the RegEx that has been working fine for some time has broken since the move from 2.0 to 4.0.
Regex:
<a\\s+[^>]*(href=\"([^#\"]+)\")[^>]*>(.*)</a>
We discount those hrefs with a hash(#) in them because this means they've already been updated but want to return all other instances. The problem comes because now our javascript functions are outputting with ' instead of single quotes which means they fall foul of the test due to the hash(#).
Has there been a change in .Net from 2.0 to 4.0 that would account for this?
UPDATE
Here is what .Net 4.0 is spitting out and has automatically changed the single quotes to ' as mentioned above.
<a class="ctl00_Menu_1 Menu_DynamicMenuItemStyle ctl00_Menu_6" href="javascript:__doPostBack('ctl00$Menu','Menu Parent\\Menu Child')" style="border-style:none;font-size:1em;">Menu Child</a>
Previously, it was outputting the following:
<a class="ctl00_Menu_1 Menu_DynamicMenuItemStyle ctl00_Menu_6" href="javascript:__doPostBack('ctl00$Menu','Menu Parent\\Menu Child')" style="border-style:none;font-size:1em;">Menu Child</a>
This was caught properly by our regex but we've had to update to the following:
#"<a\s+[^>]*(href=\""([^#\""][^\""]+)\"")[^>]*>(.*)</a>"
This now accounts for the newly appearing hashes without screening out those that are encoded as such. I've solved the problem and understand there's been a change although I'm not 100% where that change has been made. Thanks for the interest.

Problems with Request.QueryString. Reads cache instead of URL

I'm trying to retrieve the value of myID from my URL.
I'm testing this using <%=Request.QueryString["hotelid"] %>.
It only works the first time the page is loaded either in a new browser, or if my project has been rebuild.
My URL string is typical: http://my/path/to/site/?hotelid=2.
If I try <%=Request.QueryString %>, I'm also getting other values as well. Values I do not see inthe URL string.
What am I missing here?
Update:
Using <%=Request.RawUrl%>, I get the following results:
/Util/NotFound.aspx?404;http://localhost/en/Tjenester/Hotellguiden-2/Hotel-informasjon/?hotelid=3
I have NO idea what the /Util/NotFound.aspx?404 is or where it comes from.
My URL looks like this:
http://localhost/en/Tjenester/Hotellguiden-2/Hotel-informasjon/?hotelid=2
Update 2:
I'm currently investigating if it is EPiServer CMS that is using some kind of caching.
Update 3:
I have solved it. EPiServer is using EPnCachePolicyTimeout which isset to 1 hour. Setting this to 0 (zero) solved my problem.
Sometimes is really helps just writing aboutthe problem here, talking "aloud" about it and voila :)
You need to turn off caching or add your parameter names to the config attribute httpCacheVaryByParams or overwrite the custom caching key method and make it diff on every querystring parameter.

Categories