注册 登录
编程论坛 ASP.NET技术论坛

新手求助:如何在没有源代码的ASPX文件中修改下拉框的默认值

梅may 发布于 2014-12-23 17:48, 1609 次点击
我们一个系统需要修改下下拉框的默认值,可是我们没有源代码文件,只有编译后的ASPX文件,可以修改么?
如果可以,有什么方法?本人没学过,还请大神赐教
在这个aspx文件中代码是这样的:
 <asp:DropDownList ID="DropDownList_School" runat="server" onchange="changeSchoolOptions()" Width="90%" height="28px">
 </asp:DropDownList><br /><br />
其中的changeSchoolOptions()如下:
function changeSchoolOptions()   
 {   
     var dlSchool=document.getElementById("DropDownList_School");   
     var dlSpecialty=document.getElementById("DropDownList_Specialty");   
     var dlPer=document.getElementById("DropDownList_Per");   
     dlPer.length=0;   
     dlSpecialty.value = -1;
      var  lblSpecialty=document.getElementById("lblSpecialty");  
     lblSpecialty.innerText  =  "";  
     if(dlSchool.value==-1)   
     {      
         dlSchool.options.add(new Option("请选择","-1"));   
     }                                                                                                                                                                     
     else  
     {   
         search(dlSchool.value);   
     }
    return;      
 }   
function search(para)   
    {   
        var url="Search.aspx?tag=1&SchoolID="+para;        
        xmlHttpRequest=createXmlHttpRequest();   
        xmlHttpRequest.onreadystatechange=callback;      
        xmlHttpRequest.open("GET",url,true);   
        xmlHttpRequest.send(null);   
    }   
function callback()   
    {        
         var dlPer=document.getElementById("DropDownList_Per");   
         if(xmlHttpRequest.readyState==4&&xmlHttpRequest.status==200)   
         {                       
             var result=xmlHttpRequest.responseText;            
            var stringarray= result.split("|");      
            var count = stringarray.length;   
            dlPer.length=0;     
            dlPer.options.add(new Option("请选择","-1"));
            for (var i = 0; i <count-1; i++)   
            {      
                var optionarray=stringarray[i].split(",");
                var newoption=document.createElement("option");
                newoption.value=optionarray[0];
                newoption.text=optionarray[1];
               
                dlPer.options.add(newoption);    
            }     
         }   
         else  
         {   
             dlPer.length=0;   
             dlPer.options.add(new Option("请等待...","-1"));   
         }   
    }
1 回复
#2
梅may2014-12-24 12:23
已经问过开发的工程师,确实需要改源代码,不过源代码不能给我们,呵呵,还是要找公司的人。麻烦啊!
1