M
Matt
Creating Dynamic aspnet link buttons with in user control, Then i use
the control on ever page with wraped with master page. I get the url
of the link buttons from xml. Parameter from xml also Builing
Dynamicly link buttons with url's works fine. The problem is when i
click the buttons they First link button and second link button works
third fails and also when i came back and click the first one that
dont work either, page gives " The state information is invalid for
this page and might be corrupted. " Can any one Help..
Here is the Code behind for the MenuTab.asxc which get implemented by
my aspx page..
foreach (XmlNode objNode in objNodesLst)
{
objNode.Attributes["param"].Value =
queryInstanceID.ToString();
postbackUrl = objNode.Attributes["Url"].Value +
objNode.Attributes["param"].Value;
lnkButton = new LinkButton();
lnkButton.ID = objNode.Attributes["id"].Value;
lnkButton.Text =
objNode.Attributes["Name"].Value;
lnkButton.Font.Size = 8;
lnkButton.CommandName = lnkButton.ID.ToString();
lnkButton.CommandArgument = postbackUrl;
lnkButton.Command += new
CommandEventHandler(this.lnkButton_Click);
TabHolder.Controls.Add(lnkButton);
}
}
private void lnkButton_Click(object sender, CommandEventArgs e)
{
Response.Write(e.CommandName.ToString());
Response.Write(e.CommandArgument.ToString());
// Response.Redirect(e.CommandArgument.ToString()); // fails after
come back and click again
Server.Execute(e.CommandArgument.ToString());
// Server.Transfer(Session["url"].ToString());
}
the control on ever page with wraped with master page. I get the url
of the link buttons from xml. Parameter from xml also Builing
Dynamicly link buttons with url's works fine. The problem is when i
click the buttons they First link button and second link button works
third fails and also when i came back and click the first one that
dont work either, page gives " The state information is invalid for
this page and might be corrupted. " Can any one Help..
Here is the Code behind for the MenuTab.asxc which get implemented by
my aspx page..
foreach (XmlNode objNode in objNodesLst)
{
objNode.Attributes["param"].Value =
queryInstanceID.ToString();
postbackUrl = objNode.Attributes["Url"].Value +
objNode.Attributes["param"].Value;
lnkButton = new LinkButton();
lnkButton.ID = objNode.Attributes["id"].Value;
lnkButton.Text =
objNode.Attributes["Name"].Value;
lnkButton.Font.Size = 8;
lnkButton.CommandName = lnkButton.ID.ToString();
lnkButton.CommandArgument = postbackUrl;
lnkButton.Command += new
CommandEventHandler(this.lnkButton_Click);
TabHolder.Controls.Add(lnkButton);
}
}
private void lnkButton_Click(object sender, CommandEventArgs e)
{
Response.Write(e.CommandName.ToString());
Response.Write(e.CommandArgument.ToString());
// Response.Redirect(e.CommandArgument.ToString()); // fails after
come back and click again
Server.Execute(e.CommandArgument.ToString());
// Server.Transfer(Session["url"].ToString());
}