Click here to Skip to main content
15,883,999 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created a website using MVC 4 ASP.NET.
My website uses webgrid. I have a loggin page and loginpress page. When the login is successful, the user is directed to loginpress page which shows a grid of info (using webgrid) and there is an option to select any of the row in the grid. The view of the grid is perfect and data shown is perfect but when the select option is pressed, grid.selectedrow is returning null and the program is running into error.

when the row in the grid is selected it does:

@if (grid.HasSelection)
{
var SelectedRow = grid.SelectedRow; //providing null value when the row is selected
Response.Redirect("JobSelected?SelectedRow=" + SelectedRow[1].ToString() + "|" + SelectedRow[2].ToString() + "|" + SelectedRow[3].ToString() + "|" + SelectedRow[4].ToString() + "|" + SelectedRow[0].ToString());
}

Why is it returning null when the row is selected?
can someone help in this?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900