I have written this JavaScript function that locates the users current scroll position after activating/deactivating a person.
The code works well but the only weird thing is when the page is getting updated, this strange rendering happens a second before displaying the design.
What have I done wrong here? (I can also point out that I get a HTTP 302 error when this happens)
JS:
function loadDoc() {
$('.TellusAlternatingRowColor').load("AdminListUsers.aspx?column=Disabled&direc=False&a=chstat&z=+");
}
C#:
var toggleUrl = "AdminListUsers.aspx?column=" + (IsClicked.FirstOrDefault().Key ?? "Name") + "&direc=" + (IsClicked.FirstOrDefault().Value) + "&a=chstat&q=" + id.ToString() + "&d=" + disabled + "&z=" + Server.UrlEncode(txtSearchFor.Text);
var hl = new HyperLink();
hl.Text = status;
hl.Style.Add(HtmlTextWriterStyle.Color, (disabled ? "red" : "green"));
hl.NavigateUrl = toggleUrl;
hl.Attributes.Add("onclick", "loadDoc();return true;");
cell.Controls.Add(hl);
tr.Cells.Add(cell);
cell = new TableCell();
cell.Width = new Unit("10%");
cell.Controls.Add(new LiteralControl("<nobr>"));