js解決彈窗問題實現班級跳轉DIV樣本

來源:互聯網
上載者:User

js解決彈窗問題實現班級跳轉DIV樣本

 本文為大家介紹下js如何解決彈窗問題實現班級跳轉DIV,具體樣本如下,感興趣的朋友可以參考下

1、js代碼如下: 

 

代碼如下:

<%--實現班級跳轉DIV--%> 

<div id="displayClassDiv" style="display:none;" class="gp_box"> 

<ul> 

<% 

for(int i=0;i<dtPTC.Rows.Count;i++) 

if (dtPTC.Rows[i]["ISPRO"].ToString() == "1") 

 

%> 

<li> 

<h1 class="gp_title" > 

<span id='<%=dtPTC.Rows[i]["ProjectID"].ToString() %>'><%=dtPTC.Rows[i]["ProjectName"].ToString() %></span></h1> 

<% 

for (int j = 0; j < dtPTC.Rows.Count; j++) 

if (dtPTC.Rows[i]["ProjectID"].ToString() == dtPTC.Rows[j]["ProjectID"].ToString() && dtPTC.Rows[j]["ISPRO"].ToString() == "2") 

%> 

<dl class="gp_list" > 

 

<dt id='<%=dtPTC.Rows[j]["TermID"].ToString() %>'><%=dtPTC.Rows[j]["TermName"].ToString().Trim() %></dt> 

<dd class="grap"> 

 

<% 

int p_count = 0; 

for (int k = 0; k < dtPTC.Rows.Count; k++) 

 

if (dtPTC.Rows[k]["ISPRO"].ToString() == "3" && dtPTC.Rows[j]["TermID"].ToString() == dtPTC.Rows[k]["TermID"].ToString()) 

p_count++; 

if (dtPTC.Rows[k]["ClassID"].ToString() == Session["CLASSID"].ToString()) 

 

%> 

<input id='<%=dtPTC.Rows[k]["ClassID"].ToString() %>' type="radio" name="rd_class" value='<%=dtPTC.Rows[k]["ClassID"].ToString() %>' checked /><%=dtPTC.Rows[k]["ClassName"].ToString() %> 

            

<% }else 

%> 

<input id='<%=dtPTC.Rows[k]["ClassID"].ToString() %>' type="radio" name="rd_class" value='<%=dtPTC.Rows[k]["ClassID"].ToString() %>' /><%=dtPTC.Rows[k]["ClassName"].ToString() %> 

            

<% 

 

if (p_count % 2 == 0) 

%><br /><% 

%> 

 

</dd> 

</dl> 

<% 

 

 

%> 

 

</li> 

 

<% 

 

 

%> 

</ul> 

 

</div> 

 

<script type="text/javascript"> 

//顯示班級資訊的函數 

function ShowClassInfo() { 

//彈出對話方塊 

$("#displayClassDiv").dialog({ 

modal: true, 

width: '700', 

height: '400', 

title: "請選擇跳轉班級:", 

overlay: { opacity: 0.5, background: "black" }, 

buttons: { 

"確定": function () { SubmitClassInfo(); }, 

"取消": function () { $(this).dialog("destroy"); } 

}, 

close: function (event, ui) { $(this).dialog("destroy"); } 

}); 

 

function SubmitClassInfo() { 

var ObjClass = $('[name=rd_class]:checked'); 

var ClassID=ObjClass.val(); 

window.location.href = '../ClassPortal/ClassPortal.aspx?CLASS_ID='+ClassID; 

</script> 

 

2、cs檔案代碼: 

複製代碼 代碼如下:

public DataTable dtPTC = new DataTable();//儲存項目 項目分期 班級資訊 

public DataTable dtProjectInfo = new DataTable();//儲存項目資訊 

 

protected void Page_Load(object sender, EventArgs e) 

//原架構top頁面資訊開始 

//User.isSessionInvalid(); 

clsCurrentUser user = mm.GetSession(); 

USER_ID = int.Parse(user.UserID); 

 

if (Request.QueryString["ClassID"] != null) 

Session["ClASSID"] = Request.QueryString["ClassID"].ToString(); 

classid=Session["ClASSID"].ToString(); 

getClassInfo(); 

else 

classid = Session["CLASSID"].ToString(); 

getClassInfo(); 

//username = user.GetRealName(); 

username = user.UserRealName; 

time = DateTime.Now.ToString("yyyy年MM月dd日", DateTimeFormatInfo.InvariantInfo); 

//classInfo = getClassInfo(classid); 

//DtPD = dba.SelectT_LEARNING_PROJECT(Convert.ToInt32(Session["PROJECT_ID"].ToString().Trim())); 

//homepage = DtPD.Rows[0]["HOMEPAGE"].ToString().Trim(); 

//原架構top頁面資訊結束 

 

//擷取當前用記在本班中的許可權。 

string sqlRole = "select Ctype from T_PUB_USER_CLASS where ClASSID=" + Session["CLASSID"].ToString() + " and USERID=" + mm.UserID; 

DataTable dtRole = bdb.RunQuery(sqlRole); 

if (dtRole.Rows.Count > 0) 

role = dtRole.Rows[0]["Ctype"].ToString(); 

 

getALLInfo(); //根據使用者ID分別擷取項目、項目分期、班級資訊 

 

getProjectInfo();//根據使用者ID分別擷取項目 

 

/// <summary> 

/// 根據使用者ID分別擷取項目、項目分期、班級資訊 

/// </summary> 

protected void getALLInfo() 

 

int UserID = Convert.ToInt32(mm.GetSession().UserID); 

string procName = "HZX_SelectCLASS_ByUserID"; 

SqlParameter[] sp = new SqlParameter[] { new SqlParameter("@USER_ID", UserID) }; 

try 

dtPTC = bdb.RunProcQuery(procName, sp); 

catch (Exception ee) 

Response.Redirect("../../../ErrorPage.aspx"); 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.