asp.netvb.netdopostback

__doPostBack does not work


I have a master page and in this page __doPostBackdoesn't fire a post back. But I have another master page that __doPostBack works and it seems everything is the same with this other master page but __doPostBack does not work after all...

What could possibly be the reason for this?

<%@ Master Language="VB"  AutoEventWireup="false" CodeBehind="xx.master.vb" Inherits="MyProject.xx" %>

<asp:Button type="button" ID="btnSwitchLanguage" Style="display: none" runat="server" />

__doPostBack("<%= btnSwitchLanguage.UniqueID %>", lang_id);


Private Sub btnSwitchLanguage_Click(sender As Object, e As EventArgs) Handles btnSwitchLanguage.Click
    'Do Something
End Sub

Solution

  • This is too weird but I solved the problem.

    Here was the reason:

    In project we override __doPostBack function, I didn't notice it. But in the other master page it was overriden just fine, in the one I'm talking about isn't.

    In the other master page the __doPostBack func will become like this:

    __doPostBack(Param1, Param2)
    {
        var theform;
        if (window.navigator.appName.toLowerCase().indexOf('netscape') > -1)
        {
            theform = document.forms['aspnet…
    

    But in the master I'm dealing with:

    __doPostBack()
    {
       return;
    }
    

    It's weird because the order of javascript is the same too!

    Anyway, I prevent __doPostBack from be overriden and the problem solved.