I tried adding it to the end of the URL as in http://jn-svrdev1-vma6:81/spar/csp/EditSite.aspx?Hazard_ID=number. This did not work.
Today, I set the DataKeyNames="HazardID" in the asp section of GridView (found on the page that has HTML) instead of on PageLoad() in the code section (found in the C# code behind the aspx page.
I used the following in the OnSelectedChanged and erased last week's coding:
- int index = GridView1.SelectedIndex;
- // Display the primary key value of the selected row.
- txtHazard_ID.Text = GridView1.DataKeys[index].Value.ToString();

No comments:
Post a Comment