asp.net, linkbutton __doPostBack in "href" element is treated like a link, not a server event

E

Eugene

Hi All,

I was moving an asp.net application from IIS 5 to IIS 6 and ran into a
weird kind of trouble. Also, the OS of the server changed to Windows
Server 2003. Any LinkButton click event is treated not like an actual
server event, but the __doPostBack... is being put in the address bar
of the browser and the browser gives me an "Invalid syntax error". All
buttons work fine, imagebuttons too, but not the linkbuttons. Have
anyone faced that issue before? Does anyone have an idea where I
should look to fix it?

Thank you.
 
K

Ken Cox [Microsoft MVP]

Hi Eugene,

Is it possible that the pages are finding the ASP.NET client scripts?

They should be in a location such as
C:\Inetpub\wwwroot\aspnet_client\system_web\1_1_4322

Ken
 
E

Eugene

Ken Cox (Thanks, Ken), suggested the following:

"
Hi Eugene,

Is it possible that the pages are finding the ASP.NET client scripts?

They should be in a location such as
C:\Inetpub\wwwroot\aspnet_client\system_web\1_1_4322

Ken
"

What exactly are client scripts, and how would they be interacting
with asp.net so that the functionality that I put in the application
is not there?

Thank you.
 
K

Ken Cox [Microsoft MVP]

Hi Eugene,

Some of the features in ASP.NET such as validators use client-side
JavaScript from libraries. If the scripts are on your development system,
you wouldn't notice them. If they aren't on the system where you are
deploying your app, you'd run into problems.

One way to tell is to run a page on your dev system and then do View >
Source in IE.

What JavaScript do you see?

Ken
 
E

Eugene

Ken,

Thank you for your time!

I typed up a long, descriptive reply, but something happened and I got
logged out. So, I will be shorter this time.

That's the JavaScript from my production server:

<form name="Form1" method="post" action="login.aspx"
language="javascript" onsubmit="if (!ValidatorOnSubmit()) return
false;" id="Form1">

<script language="javascript" type="text/javascript">
<!--
var Page_Validators = new Array(document.all["RFValLogin"],
document.all["RegExLogin"], document.all["RFValPass"],
document.all["RegExPass"]);
// -->
</script>


<script language="javascript" type="text/javascript">
<!--
var Page_ValidationActive = false;
if (typeof(clientInformation) != "undefined" &&
clientInformation.appName.indexOf("Explorer") != -1) {
if ((typeof(Page_ValidationVer) != "undefined") &&
(Page_ValidationVer == "125"))
ValidatorOnLoad();
}

function ValidatorOnSubmit() {
if (Page_ValidationActive) {
return ValidatorCommonOnSubmit();
}
return true;
}
// -->
</script>

The JavaScript from my development server is almost the same, it has a
little more attributes in some functions:

<script language="javascript">
<!--
var Page_Validators = new Array(document.all["RFValLogin"],
document.all["RegExLogin"], document.all["RFValPass"],
document.all["RegExPass"]);
// -->
</script>


<script language="javascript">
<!--
var Page_ValidationActive = false;
if (typeof(clientInformation) != "undefined" &&
clientInformation.appName.indexOf("Explorer") != -1) {
if (typeof(Page_ValidationVer) == "undefined")
alert("Unable to find script library
'/aspnet_client/system_web/1_1_4322/WebUIValidation.js'. Try placing
this file manually, or reinstall by running 'aspnet_regiis -c'.");
else if (Page_ValidationVer != "125")
alert("This page uses an incorrect version of
WebUIValidation.js. The page expects version 125. The script library
is " + Page_ValidationVer + ".");
else
ValidatorOnLoad();
}

function ValidatorOnSubmit() {
if (Page_ValidationActive) {
ValidatorCommonOnSubmit();
}
}
// -->
</script>

and some functions are written a bit differently:

<form name="Form1" method="post"
action="login.aspx?ReturnUrl=%2fInOut%2fDefault.aspx"
language="javascript" onsubmit="ValidatorOnSubmit();" id="Form1">


But that might be because the development version has @Page directive
which says Debug="true". On the other hand, production version was
deployed using the Web Setup Project. So I don't have those .resx and
..vb files hanging around the virtual directory.

My development machine (XP Pro, SP1, IIS 5) has everything running
smootly. The server (Windows Server 2003, IIS 6) has those troubles.
Moreover, I cannot even log in now. The application does not reply to
button click events.

What do you think?

Thanks again,

Eugene
 
E

Eugene

Ken,

This is what I did that worked: aspnet_regiis -i

This might sound like a "DUH" kind of answer, but I did not have to
deal with Windows Server 2003 and IIS 6.

I am knocking on wood, because before it was also working and then
stopped working.

If there is nothing else in this post - it worked.

Thank you.

Eugene
 
K

Ken Cox [Microsoft MVP]

Glad to hear you got going!

It sure can be frustrating. Imagine if a car acted up like that just 'cause
you adjusted the seat. <grin>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top