My computer has automatic installed Internet Explorer 9 and my programs has started to act weard. Can anyone tell me what happens? It seems that comparisons does not work any longer?
What do I have to do to adjust my programs to Explorer 9?
Yes this is web-applications written in WebMatrix and C. As example the following code crash when I try to run it. This worked perfectly in the previous Explorer version.
if(IsPost){
foreach (string dataItem in OrderDatum.Split(delimiterChar)) {
ant = ant + 1;
if (ant == 1){
f1 = dataItem;}
if (ant == 2){
f2 = dataItem;}
if (ant == 3){
f3 = dataItem;}
}}
Unfortunatelly the error message is in swedish but this is some text from the error-message:
[RuntimeBinderException: Det går inte att utföra bindning under körning för en null-referens] CallSite.Target(Closure , CallSite , Object , Char[] ) +133 ASP._Page_AktieÄndra_cshtml.Execute() in c:\Users\GC\Documents\My Web Sites\Calasfonden\AktieÄndra.cshtml:209
System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +207
Fantastic, you even read swedish. My programs is still in "development mode" and is run on my own computer.
Best regards
Gunnar Calais
If it to any help I have copied the complete error message below:
Serverfel i tillämpningsprogrammet /.
Det går inte att utföra bindning under körning för en null-referens
Beskrivning:
Ett undantag som inte kunde hanteras uppstod när den aktuella webbegäran kördes. Mer information om felet och var i koden det uppstod finns i stackspårningen.
Undantagsinformation: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Det går inte att utföra bindning under körning för en null-referens Källfel:
Rad 207: Rad 208: if(IsPost){ Rad 209: foreach (string dataItem in OrderDatum.Split(delimiterChar)) {
Rad 210: ant = ant + 1; Rad 211: if (ant == 1){
Källfil: c:\Users\GC\Documents\My Web Sites\Calasfonden\AktieÄndra.cshtml Rad:
209 Stackspårning:
[RuntimeBinderException: Det går inte att utföra bindning under körning för en null-referens]
CallSite.Target(Closure , CallSite , Object , Char[] ) +133
ASP._Page_AktieÄndra_cshtml.Execute() in c:\Users\GC\Documents\My Web Sites\Calasfonden\AktieÄndra.cshtml:209
System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +207
System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors) +68
System.Web.WebPages.WebPage.ExecutePageHierarchy() +156
System.Web.WebPages.StartPage.RunPage() +19
System.Web.WebPages.StartPage.ExecutePageHierarchy() +65
System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +76
System.Web.WebPages.WebPageHttpHandler.ProcessRequestInternal(HttpContext context) +249
OrderDatum is an nvarchar field and the value is blank. As I understand Explorer 9 interpret the blank field in a different way than before. The following code makes a test on OrderTyp if not equal to space, so the code that brakes the program should not
even be executed. It seems that you cant do the test on space with an ""?
The value in OrderTyp is space so nothing after the test should be executed.
if
(OrderTyp != ""){
char[]
delimiterChar = {'-'};
var
f1 = "";
var
f2 = "";
var
f3 = "";
int
ant = 0;
if(IsPost){
if
(OrderTyp != ""){
if
(OrderDatum == ""){
OrderDatum = dd;}}}
if(IsPost){
foreach
(string
dataItem in
OrderDatum.Split(delimiterChar)) {
ant = ant + 1;
if
(ant == 1){
f1 = dataItem;}
if
(ant == 2){
f2 = dataItem;}
if
(ant == 3){
f3 = dataItem;}
}}
@*
Koll av år *@
if(IsPost){
if
(f1 == "")
{FelSw = "Fel";
AntalFel = 1;
Felmedd1 = "1.
Datum fel";}
if
(f2 == "")
{FelSw = "Fel";
AntalFel = 1;
Felmedd1 = "1.
Datum fel";}
if
(f3 == "")
{FelSw = "Fel";
AntalFel = 1;
Felmedd1 = "1.
Datum fel";}
var
nf1 = f1.AsDecimal();
....... mopre code for testing the date.....
the
codes end with the following:
}}
}
This is the end-paranthese for the first one after the test on OrderTyp in the beginning of the code.
The
program has been working perfect for two month now, and the problem started after that the Explorer 9 was installed. So, it has to have with the new Explorer-version to do.
Hope
you can help me! And thank you for your effort.
Not much of that makes sense to me. Internet Explorer has nothing to do with server-side code. You don't test to see of OrderTyp is a space anywhere in the code. What you need to do is to test to see if OrderDatum is null or not:
I would just like to confirm what I said in the last posting. I have now tested Google Crome instead and the system works perfectly wit Crome, so the problem must be related to Explorer 9.
Thank's for your proposal. I tested that but it does not make any difference. After several tests it seems that Explorer 9 does not get the results from a Request. I have tested other programs and Explorer obviosly can not "read" the requested fields. As
I said Google Crome works perfectly.
Gunnar Calai...
Member
34 Points
31 Posts
What happens with Explorer 9
Feb 23, 2012 04:02 PM|LINK
Hello!
My computer has automatic installed Internet Explorer 9 and my programs has started to act weard. Can anyone tell me what happens? It seems that comparisons does not work any longer?
What do I have to do to adjust my programs to Explorer 9?
Best regards
Gunnar Calais
bbcompent1
All-Star
32992 Points
8508 Posts
Moderator
Re: What happens with Explorer 9
Feb 23, 2012 04:08 PM|LINK
Are these web applications? If so, there are overrides you can use to make it compatible. Can you specify what you mean by programs?
Gunnar Calai...
Member
34 Points
31 Posts
Re: What happens with Explorer 9
Feb 23, 2012 04:22 PM|LINK
Hello again!
Yes this is web-applications written in WebMatrix and C. As example the following code crash when I try to run it. This worked perfectly in the previous Explorer version.
if(IsPost){
foreach (string dataItem in OrderDatum.Split(delimiterChar)) {
ant = ant + 1;
if (ant == 1){
f1 = dataItem;}
if (ant == 2){
f2 = dataItem;}
if (ant == 3){
f3 = dataItem;}
}}
Unfortunatelly the error message is in swedish but this is some text from the error-message:
[RuntimeBinderException: Det går inte att utföra bindning under körning för en null-referens] CallSite.Target(Closure , CallSite , Object , Char[] ) +133 ASP._Page_AktieÄndra_cshtml.Execute() in c:\Users\GC\Documents\My Web Sites\Calasfonden\AktieÄndra.cshtml:209 System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +207
I would be grateful for some help!
Best regards
Gunnar Calais
bbcompent1
All-Star
32992 Points
8508 Posts
Moderator
Re: What happens with Explorer 9
Feb 23, 2012 04:52 PM|LINK
Ok, converted Swedish to English, the error is:
[RuntimeBinderException: Unable to perform the binding at runtime for a null reference] CallSite.Target (Closure, Call Site, Object, Char []) +133 ASP._Page_AktieÄndra_cshtml.Execute () in c: \ Users \ GC \ Documents \ My Web Sites \ Calasfonden \ AktieÄndra.cshtml: 209 System.Web.WebPages.WebPageBase.ExecutePageHierarchy () +207
I'm not exactly sure why IE 9 would cause that. Where are you seeing this happen? In visual studio development server? On Production?
Gunnar Calai...
Member
34 Points
31 Posts
Re: What happens with Explorer 9
Feb 23, 2012 05:00 PM|LINK
Hello again!
Fantastic, you even read swedish. My programs is still in "development mode" and is run on my own computer.
Best regards
Gunnar Calais
If it to any help I have copied the complete error message below:
Serverfel i tillämpningsprogrammet /.
Det går inte att utföra bindning under körning för en null-referens
Beskrivning: Ett undantag som inte kunde hanteras uppstod när den aktuella webbegäran kördes. Mer information om felet och var i koden det uppstod finns i stackspårningen.
Undantagsinformation: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Det går inte att utföra bindning under körning för en null-referens
Källfel:
Rad 207: Rad 208: if(IsPost){ Rad 209: foreach (string dataItem in OrderDatum.Split(delimiterChar)) { Rad 210: ant = ant + 1; Rad 211: if (ant == 1){
Källfil: c:\Users\GC\Documents\My Web Sites\Calasfonden\AktieÄndra.cshtml Rad: 209
Stackspårning:
Mikesdotnett...
All-Star
154887 Points
19862 Posts
Moderator
MVP
Re: What happens with Explorer 9
Feb 23, 2012 05:38 PM|LINK
That error has nothing to do with the browser at all. What data type is OrderDatum? How is it generated?
Beginning ASP.NET Web Pages with WebMatrix | My Site | Twitter
Gunnar Calai...
Member
34 Points
31 Posts
Re: What happens with Explorer 9
Feb 23, 2012 06:30 PM|LINK
Hello again!
OrderDatum is an nvarchar field and the value is blank. As I understand Explorer 9 interpret the blank field in a different way than before. The following code makes a test on OrderTyp if not equal to space, so the code that brakes the program should not even be executed. It seems that you cant do the test on space with an ""?
The value in OrderTyp is space so nothing after the test should be executed.
if (OrderTyp != ""){
char[] delimiterChar = {'-'};
var f1 = "";
var f2 = "";
var f3 = "";
int ant = 0;
if(IsPost){
if (OrderTyp != ""){
if (OrderDatum == ""){
OrderDatum = dd;}}}
if(IsPost){
foreach (string dataItem in OrderDatum.Split(delimiterChar)) {
ant = ant + 1;
if (ant == 1){
f1 = dataItem;}
if (ant == 2){
f2 = dataItem;}
if (ant == 3){
f3 = dataItem;}
}}
@* Koll av år *@
if(IsPost){
if (f1 == "") {FelSw = "Fel"; AntalFel = 1; Felmedd1 = "1. Datum fel";}
if (f2 == "") {FelSw = "Fel"; AntalFel = 1; Felmedd1 = "1. Datum fel";}
if (f3 == "") {FelSw = "Fel"; AntalFel = 1; Felmedd1 = "1. Datum fel";}
var nf1 = f1.AsDecimal();
....... mopre code for testing the date.....
the codes end with the following:
}}
} This is the end-paranthese for the first one after the test on OrderTyp in the beginning of the code.
The program has been working perfect for two month now, and the problem started after that the Explorer 9 was installed. So, it has to have with the new Explorer-version to do.
Hope you can help me! And thank you for your effort.
Best regards
Gunnar Calais
Mikesdotnett...
All-Star
154887 Points
19862 Posts
Moderator
MVP
Re: What happens with Explorer 9
Feb 23, 2012 07:31 PM|LINK
Not much of that makes sense to me. Internet Explorer has nothing to do with server-side code. You don't test to see of OrderTyp is a space anywhere in the code. What you need to do is to test to see if OrderDatum is null or not:
if(IsPost){ if(OrderDatum != null){ foreach (string dataItem in OrderDatum.Split(delimiterChar)) { //etcBeginning ASP.NET Web Pages with WebMatrix | My Site | Twitter
Gunnar Calai...
Member
34 Points
31 Posts
Re: What happens with Explorer 9
Feb 23, 2012 07:38 PM|LINK
Hello again!
I would just like to confirm what I said in the last posting. I have now tested Google Crome instead and the system works perfectly wit Crome, so the problem must be related to Explorer 9.
Best regards
Gunnar Calais
Gunnar Calai...
Member
34 Points
31 Posts
Re: What happens with Explorer 9
Feb 23, 2012 07:50 PM|LINK
Hello again!
Thank's for your proposal. I tested that but it does not make any difference. After several tests it seems that Explorer 9 does not get the results from a Request. I have tested other programs and Explorer obviosly can not "read" the requested fields. As I said Google Crome works perfectly.
Do you have any idea?
Best regards
Gunnar Calais