urlrewriting.net not accepting arabic query string - c#

i am going crazy, i have tried everything, urlencode, html encode, but urlrewriting.net is reading Arabic querystring as ?? charecters
totally appreciate the help

If you have .NET 3.5 SP1 installed, I'd recommend you to switch to System.Web.Routing instead of the UrlRewriting.net library. I've recently switched from UrlRewriting.net to System.Web.Routing myself and routing is so much better thought out and better integrated with the ASP.NET pipeline.
If you have the opportunity to switch, I'd recommend it. If not, please post your UrlRewriting.net configuration file so we can tweak the regular expressions that apparently aren't working. Please post some examples of URIs that don't work too.
Also, what's the values defined in the web.config section:
<system.web>
<globalization requestEncoding="utf-8"
responseEncoding="utf-8"
fileEncoding="utf-8" />
</system.web>
Like in the above example, use UTF-8. Also be sure to encode the characters as UTF-8 in the URI.

What happens when you run the IIS 7 application in "Classic Mode" (might require installation to be an available option)?

After long tedious trials My advise to anyone who is using URL Rewriting with IIS 7 in integrated mode, stop wasting your time and either use MVC routing or forget about Arabic Strings in URL

Try this , it is faster .. and problems free .
"~/News/2008/10/10/newsid/تجربة.aspx"
where newsid is the ID of your article .
Get your title from the database : 'select * from news where id = ' & newsid
It is much faster than : "select * from news where title='"& title &"'"

it seems that i have solved the problem by making sure that both pages, the one that contains the link and the one to parse the query string have UTF-8 Encoding
but now i got another problem
Firefox is displaying the hyper link and the link in address bar correctly
but in IE6 and Ie 7 it is like this
mysite/News/2008/10/10/%D8%AA%D8%AC%D8%B1%D8%A8%D8%A9.aspx
even though IE 6 and 7 are parsing the link fine, but this is ugly, what is the solution please ?

Update: man you wont believe it, i have found the problem it is so strange, it is with IIS 7 Integrated Mode,
try to launch your page from visual studio Dev server and Unicode characters will be parsed just fine, but if you launch the page from IIS 7 it will give you the ???? characters.
hope some body will shade some light here

Related

Published .aspx only shows plain html

Today i made a quick template for a landingpage and wanted to test it on my webhotel. I have never actually published a website on a webhotel before, but the initial process in asp.net was pretty flawless.
The way i got my webpage onto the server, was by publishing my project and transferring it to my server on a FTP connection.
However, when i open my up my webpage, it only shows the html code, which is really weird. .
http://bkrt.dk/Index.aspx
What may i have done wrong, and How do i solve this issue?
Turns out that my webhotel doesnt support .aspx, but only php!
- Solution is that i either change webhotel, or do a full convertion to html, which seems to be no option. I will therefore look for a webhotel with asp.net support.

RequiredFieldValidator client side validations do not work on IE 10

All my webforms using RequiredFieldValidator, RegularExpressionValidator and ValidationSummary are not working on IE 10. It is working fine on any other browsers. It is strangely doing postback which does not happen on any other browsers.
Another strange thing is when I open developer console(F12), it seems to be working but it is still doing postback. All these Validations should occur at client side by default.
Has anyone here faced similar problem?
please check these link1 and link2
Edit:
I got this fix from.. Hanselman
Browser Definition files shipped with .Net 2.0 and .Net 4.0 contains defintions for certain range of browser versions. By default, ASP.NET uses sniffing technology for the user agent string to detect browsers. The browser definition files cover a certain range of browser versions.As the version numbers increase, ASP.NET might not recognize new versions of a browser by using the user agent string. In this case, ASP.NET might handle these versions as an unknown browser and causes inconvenience.
FIX
The fix is to get updated browser-definition files.
You can install a machine-wide fix or just fix individual projects.
Hotfixes are availble with download links.
- .Net 4
- .Net 2.0

Problem with posting values from ASP.NET to mysql

I'm developing a web site with mysql backend and I have the following problem. The site has a Search page that takes parameters in TextBoxes. When I'm posting the form and building the criteria from the values mysql doesn't return anything when I use greek characters. When I'm using Mysql Query Browser the same query works fine. I've set globalization in web.config and have everything in utf-8 encoding. Please Help.
I had a similar problem in PHP recently and had to run some SQL before each query along the lines of:
SET NAMES 'utf8'
Or:
SET CHARACTER SET utf8
Might be worth giving this a try? Hopefully it will help.

Finding more information about browser versions with C#/ASP.Net

First, some background to my problem.
There are many versions of Internet Explorer 6 and 7 that do not support more than 20 Key-Value pairs in a cookie. I have a list of full versions that do and do not support this. This is fixed in a windows update, but it's not possible for me to force the users of my app to carry out windows update in order to use my app.
We have developed a different cookie jar for versions of Internet Explorer that do not support this, however the performance of this is not optimal, and therefore we need to only use this on versions of IE that require it.
The full version number of an IE browser is in the format 6.00.2900.2180. Everywhere I have found suggests using Request.Browser to find out browser information, but this is far too limited for my needs. To clarify this, MajorVersion returns 6, and MinorVersion returns 0, giving me 6.0 (6.0 is the version of pretty much every version of Internet Explorer 6 that exists). So what I need is the third and fourth parts (or at the very least, the third part) of the full version.
So, does anyone know of a way, in ASP.Net with C#, to find out the information I need? If someone has looked extensively into this and found it to impossible, that is fine as an answer.
You may need to revisit why you're storing so many different key-value pairs. Going low-tech, couldn't you concatenate the values into fewer or maybe even a single key? What sort of values are you storing--in a cookie?
Try grabbing the "User-Agent" request header using Request.Headers
Copying this from meandmycode to accept it as answer.
IE doesn't specify the long version
number in the user-agent header so you
have absolute no chance of detecting
this other than sending a 'snoop' page
with javascript to detect the complex
version number.. but doing something
like that is dodge city, and
javascript may not be able to find the
full version either.

Making my ASP.NET website compatible with Firefox?

I have an ASP.net website ( http://www.erate.co.za ) version 2.0.
When someone opens my website in Firefox everything looks different.
Why is that and how can I make it compatible?
Please help!
Etienne
The problems don't have anything to do with ASP.NET / C# Specifically.
They have to do with your understanding of web design / HTML / CSS and how you can make a cross-browser compatible UI.
I'd suggest you look at http://www.w3schools.com/ for some information on good web design practices.
Some obvious problems with the Source that you need to address are
No common css Stylesheets
Styles are applied inline on lots of elements
using long strings of " " to align text
The underlying server technology should not have any impact on your websites appearence as long as you are just producing HTML.
What you need to do is make sure that your HTML and CSS works as intended in all browsers. A good way to start is to make sure that you only output standards compliant code.
The issue at hand is that styles that you are using don't work in firefox such as cursor:hand; versus cursor:pointer; both work in IE but only pointer works in firefox. A quick recommendation would be to just run the resultant page through the w3c validator located at: http://validator.w3.org/
Per se, ASP.NET produce vanilla HTML/Javascript, so there's nothing wrong with the technology.
Focus on the html, try to be as close as possible to the w3c standards, it should help a lot.
Firebug, an incredible web dev extension for Firefox should also help you a lot in debugging your CSS.
It might be a painful task, especially if your site is old and big. Good luck!

Categories