Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am calling this function when the user clicks on More/less criteria button in our webpage.that is if u click on MoreCriteria Button it gives more options to search in our web page.My question is when u minimize the website to about 1/4 of the screen width horizontally the website locksup nothing works and we have to purposely close the web page.so i need a solution for it that is it shouldnot lockup.

I have find the line where it gets lockup that is: script += " document.all('" + AdvCritTableIdOrReflowTagId + "').Show('"+ advCriteriaPropertyName + "', '" + advCriteriaPropertyValue + "');";

If could anyone tell me what could be replacement code for the above mention line.

Programing langauge used is ASP,Javascript
Browser:IE7,IE8,IE6


C#
function AddMoreLessButton(strMoreLiteral, strLessLiteral, inpAdvActiveValue,
                            formName, hdnInpAdvActiveName, AdvCritTableIdOrReflowTagId, advCriteriaPropertyName,
                            advCriteriaPropertyValue, oStringBuilder)
{
    var val;
    if(inpAdvActiveValue == "1") val = strLessLiteral; else val = strMoreLiteral;
    var btn = "<input type='button' class='btn' name='btnMoreCriteria' id='btnMoreCriteria'";
    btn += " value='" + val + "'";
    btn += " onclick='MoreCriteriaClicked(); return false;'";
    btn += " morelit='" + strMoreLiteral + "' lesslit='" + strLessLiteral + "'/>";

    if(oStringBuilder){
        oStringBuilder.Append(btn);
    } else {
        Response.Write(btn);
    }

    var script = "<";
    script += "script language=javascript defer='defer'>";
    script += " function MoreCriteriaClicked(){ ";
    script += " var oBtn = document.all('btnMoreCriteria'); ";
    script += " if(oBtn.value == oBtn.morelit) DisplayMoreCriteria(oBtn);";
    script += " else DisplayLessCriteria(oBtn); } ";


    script += "function DisplayMoreCriteria(oBtn){";
    script += "try{";
    script += " try{";
    script += " oBtn.style.display = '';";
    script += "     document.all('" + AdvCritTableIdOrReflowTagId + "').Show('"+ advCriteriaPropertyName + "', '" + advCriteriaPropertyValue + "');";
    script += " }catch(e){ document.all." + AdvCritTableIdOrReflowTagId + ".style.display='inline';}";
    script += " document.forms." + formName + "." + hdnInpAdvActiveName + ".value = '1';";
    script += " oBtn.value = oBtn.lesslit;}catch(e){}}";

    script += "function DisplayLessCriteria(oBtn){";
    script += "try{";
    script += " try{";
    script += " oBtn.style.display = '';";
    script += "     document.all('" + AdvCritTableIdOrReflowTagId + "').Hide('"+ advCriteriaPropertyName + "', '" + advCriteriaPropertyValue + "');";
    script += " }catch(e){ document.all." + AdvCritTableIdOrReflowTagId + ".style.display='none';}";
    script += " document.forms." + formName + "." + hdnInpAdvActiveName + ".value = '0';";
    script += " oBtn.value = oBtn.morelit;}catch(e){}}";

    if(inpAdvActiveValue == "1"){
        //script += "objILConstructors.register(function(){var oBtn = document.all('btnMoreCriteria')});";
        script += "objILConstructors.register(function(){var oBtn = document.all('btnMoreCriteria'); DisplayMoreCriteria(oBtn);});";
        script += "var oBtn = document.all('btnMoreCriteria');";
        script += " DisplayMoreCriteria(oBtn);";
    }
    else
      {
         script += "objILConstructors.register(function(){var oBtn = document.all('btnMoreCriteria');DisplayLessCriteria(oBtn);});";
      }


    script += " AdvActiveNodeName='" + hdnInpAdvActiveName + "';";
    script += " <\/script>";

    if(oStringBuilder){
        oStringBuilder.Append(script);
    } else {
        Response.Write(script);
    }

}
Posted
Updated 29-Sep-10 18:20pm
v4
Comments
aidin Tajadod 29-Sep-10 22:14pm    
when you minimize your web page, do you send any thing to the server? do you handle page_resize event on your page?
It does not seem server side problem.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900