1
votes

I am trying to open a module popup which binds, but it shows an error. The code I'm using is:

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);
}

It shows this error:

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 (:).

So, how can I open the module according to studentID from a data grid?

1

1 Answers

2
votes

You cannot do a response.redirect to a popup URL.

The PopUp url has some javascript in it and isn't just a regular URL.

Your better option would be to use a HyperLink in your student attendance list and simply set the NavigateUrl to that of your PopUrl on ItemDataBound!