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

Discussion in 'ASP .Net Web Controls' started by Eugene, Nov 7, 2004.

  1. Eugene

    Eugene Guest

    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.
     
    Eugene, Nov 7, 2004
    #1
    1. Advertising

  2. 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

    "Eugene" <> wrote in message
    news:...
    > 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.
     
    Ken Cox [Microsoft MVP], Nov 8, 2004
    #2
    1. Advertising

  3. Eugene

    Eugene Guest

    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.
     
    Eugene, Nov 9, 2004
    #3
  4. 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


    "Eugene" <> wrote in message
    news:...
    > 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.
     
    Ken Cox [Microsoft MVP], Nov 9, 2004
    #4
  5. Eugene

    Eugene Guest

    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
     
    Eugene, Nov 11, 2004
    #5
  6. Eugene

    Eugene Guest

    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
     
    Eugene, Nov 11, 2004
    #6
  7. 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>

    "Eugene" <> wrote in message
    news:...
    > 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
     
    Ken Cox [Microsoft MVP], Nov 11, 2004
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jim Heavey
    Replies:
    1
    Views:
    375
    Oisín Grehan
    Dec 2, 2003
  2. =?Utf-8?B?TGFuY2UgQWhsYmVyZw==?=

    ASP.NET 2.0 Page with LinkButton & __doPostBack client side script missing

    =?Utf-8?B?TGFuY2UgQWhsYmVyZw==?=, May 6, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    990
    =?Utf-8?B?TGFuY2UgQWhsYmVyZw==?=
    May 6, 2004
  3. Sathyaish
    Replies:
    3
    Views:
    3,110
    Sathyaish
    Sep 8, 2005
  4. Jeffrey
    Replies:
    2
    Views:
    598
    Anthony Williams
    Feb 18, 2004
  5. Sathyaish

    Linkbutton does not look like a linkbutton

    Sathyaish, Sep 8, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    188
    Sathyaish
    Sep 8, 2005
Loading...

Share This Page