2013-02-15 45 views
1

我想打開一個綁定的模塊彈出窗口,但它顯示一個錯誤。我正在使用的代碼是:DotNetNuke中的Open Module Url?

protected void grdStudentAttendanceList_RowCommand(object sender, GridViewCommandEventArgs e) 
{ 
    if (e.CommandName == "ViewStudent") 
    { 
     lbntSurnnameClick(e.CommandArgument.ToString()); 
    } 
} 

void lbntSurnnameClick(string StudentID) 
{ 
    string url = UrlUtils.PopUpUrl(EditUrl("StudentID", StudentID, "AddOrUpdateStudent"), this, PortalSettings,true,false, 390, 670); 
    Response.Redirect(url); 
} 

它顯示了這個錯誤:

potentially dangerous Request.Path value was detected from the client (:).

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: A potentially dangerous Request.Path value was detected from the client (:).

那麼,怎樣才能根據studentID從數據網格我打開模塊?

回答

2

你不能對一個彈出的URL做一個response.redirect。

PopUp網址中包含一些JavaScript,不僅僅是一個普通的URL。

你最好的選擇是在學生考勤表中使用HyperLink,並簡單地將NavigateUrl設置爲ItemDataBound上PopUrl的NavigateUrl!