Why ASP.NEt C# doPostBack function is not appearing in the Html code?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Saul Fells

    #1

    Why ASP.NEt C# doPostBack function is not appearing in the Html code?

    I have a form with multiple dropdownlist and each list has onselectedindex changed defined.

    Code:
    <asp:DropDownList ID="SPR" runat="server" OnSelectedIndexChanged="Reload_OnSelectedIndexChanged" AutoPostBack="true">
        <asp:ListItem Text="1 day" Value="1:D"></asp:ListItem>
        <asp:ListItem Text="5 days" Value="5:D"></asp:ListItem>
        <asp:ListItem Text="1 month" Value="1:M"></asp:ListItem>
        <asp:ListItem Text="3 months" Value="3:M"></asp:ListItem>
        <asp:ListItem Text="6 months" Value="6:M"></asp:ListItem>
        <asp:ListItem Text="1 year" Value="1:Y"></asp:ListItem>
        <asp:ListItem Text="2 years" Value="2:Y"></asp:ListItem>
    </asp:DropDownList>
    So when I run the page I expect to receive the postbackcode and the select code with the onchange property defined.

    When I invoke the pages in Explorer, Safari or Chrome everything works fine but in Firefox the __doPostBack function and the onchange property in the select tags are not defined. Why is that?
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    I don't know why....it should work.
    Do you have other JavaScript on the page that might be interfering with the process?

    -Frinny

    Comment

    • Saul Fell

      #3
      Yes, but there is something tricky. If I change the user agent in Firefox, the code appears and the page works just fine. Why is that? The IIS identify which navigator I am using and decide to give some functionality or not?

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        A friend of mine claimed that that occurs... But I've never experienced it myself.
        I use FireFox as my main browser when testing (have been for the last 5 years) and I haven't experienced what you're describing.

        What version of the .NET framework are you developing with?

        Comment

        • Saúl Fells

          #5
          Another thing, if i run an instance in my computer (debugging from VS2008) and "visit" the page from firefox the code appears, but when i take the project in "production server" the code doen't appear, there is a configuration of the iis that i have to do?

          Comment

          • Frinavale
            Recognized Expert Expert
            • Oct 2006
            • 9749

            #6
            Nope, ASP.NET should generate the necessary JavaScript responsible for preforming this task. In fact the __doPostback() method is required for most page submittions ... it should work fine.

            Comment

            • Saul Fells

              #7
              Yeah, I know that, but I don't know why is not displaying the code just in Firefox. So, I'm still not able to see the code. Telling to the user to change the user agent is not a viable answer.

              Comment

              Working...