Multiview for inserting and editing users I have a multiview to insert and edit users. Users are listed in a gridview. In selectedindexchanged event of gridview I've placed this code:

protected void GrvList_SelectedIndexChanged(object sender, EventArgs e)
{
    // EditView
    FrmaddEditUsers.ActiveViewIndex = 1;
    // Get Username
    UserName.Text = GrvList.DataKeys[GrvList.SelectedIndex].Value.ToString();
}


I wonder if it's necessary to change it as below, being afraid of values are changed by bad users:

protected void GrvList_SelectedIndexChanged(object sender, EventArgs e)
{
    // change to EditView
    FrmaddEditUsers.ActiveViewIndex = 1;
    // Get Username from gridview and display in txtbox
    string ToBeEditedUser = GrvList.DataKeys[GrvList.SelectedIndex].Value.ToString();
    UserName.Text = HttpUtility.HtmlEncode(ToBeEditedUser);
}
It certainly wouldn't do any harm and if you users have a backend that does not do something like encode when the user's name goes into the database then this will prevent any nasties.