开发者

How do i make a .NET/JavaScript login page which is compatible with IE7, Chrome, Mozilla and Safari?

I have a .NET login page. It works properly in Internet Explorer 7, but i want to make it compatible with Chrome, Mozilla and Safari.

The login code behind is:

Protected Sub btnLogin_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnLogin.Click

{..................

ScriptManager.RegisterStartupScript(Me, Me.GetType(), "test", "login()", True)

........}

The ASPX page code is:

function login()

{

    if(document.getElementById("ctl00_Sidebar_Contentplaceholder_Lo1_SaveFlag").value =="Y") 

    {
        window.open("Home.aspx?PlotRef=" + document.all(开发者_如何学Go"ctl00_Sidebar_Contentplaceholder_Lo1_SaveFlag").value + "&print=print","",'location=no,fullscreen=no,menubar=no,titlebar=yes,status=yes,toolbar=no,scrollbars=yes,resizable=yes');    

        if(document.getElementById("ctl00_Sidebar_Contentplaceholder_Lo1_hidChangePass").value =="Y") 
        {
            window.open("ChangePass.aspx","ChangePassword","top=50,left=50,height=310,width=725,location=no,menubar=no,status=yes,addressbar=no,toolbar=no,scrollbars=no,fullscreen=no,resizable=no")
        }  

        window.open('','_self','');
        window.close();      
    }
} 

This is not working. I tried to debug it, but in debug mode the cursor only steps through the code behind. I'm not able to enter the javascript login() function on the aspx page.


If you want to debug your javascript then you can add "debugger;" to your code, this should act as a breakpoint for the browser's built in debugger (where it has one, Chrome does).

Is document.all actually what you want to use here? Would getElementById or getElementsByName work just as well but also be supported in all browsers?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜