SoFunction
Updated on 2025-04-09

Thirty-three commonly used codes page 6/7


26. Dialog Box
private static string ScriptBegin = "<script language=\"JavaScript\">"; 
private static string ScriptEnd = "</script>"; 
public static void ConfirmMessageBox(string PageTarget,string Content) 

 string ConfirmContent="var retValue=('"+Content+"');"+"if(retValue){='"+PageTarget+"';}"; 
 ConfirmContent=ScriptBegin + ConfirmContent + ScriptEnd; 
 Page ParameterPage = (Page); 
 ("confirm",ConfirmContent); 
 //(strScript); 

27. Format the time: string aa=("yyyy year MM month dd day");
1.1 Take the current year, month, day, hour, minute, and second
currentTime=; 
1.2 Take the current year
int year= ;
1.3 Take the current month
int month= ;
1.4 Take the current day
int day= ;
1.5 Take the current time
Int time= ;
1.6 Get the current score
int point = ;
1.7 Take the current second
int seconds= ;
1.8 Take the current millisecond
int milliseconds= ;
28. Custom paging code:
Define the variable first:
public static int pageCount; //Total number of pages
public static int curPageIndex=1; //Current page
Next page:
if( < ( - 1)) 

  += 1; 
 curPageIndex+=1; 

bind(); // DataGrid1 data binding function
Previous page:
if( >0) 

  += 1; 
 curPageIndex-=1; 

bind(); // DataGrid1 data binding function
Direct page jump:
int a=(());//() is the jump value
if(a<) 

 this.=a; 

bind(); 
Previous page1234567Next pageRead the full text