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.Attribu tes["param"].Value =
queryInstanceID .ToString();
postbackUrl = objNode.Attribu tes["Url"].Value +
objNode.Attribu tes["param"].Value;
lnkButton = new LinkButton();
lnkButton.ID = objNode.Attribu tes["id"].Value;
lnkButton.Text =
objNode.Attribu tes["Name"].Value;
lnkButton.Font. Size = 8;
lnkButton.Comma ndName = lnkButton.ID.To String();
lnkButton.Comma ndArgument = postbackUrl;
lnkButton.Comma nd += new
CommandEventHan dler(this.lnkBu tton_Click);
TabHolder.Contr ols.Add(lnkButt on);
}
}
private void lnkButton_Click (object sender, CommandEventArg s e)
{
Response.Write( e.CommandName.T oString());
Response.Write( e.CommandArgume nt.ToString());
// Response.Redire ct(e.CommandArg ument.ToString( )); // fails after
come back and click again
Server.Execute( e.CommandArgume nt.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.Attribu tes["param"].Value =
queryInstanceID .ToString();
postbackUrl = objNode.Attribu tes["Url"].Value +
objNode.Attribu tes["param"].Value;
lnkButton = new LinkButton();
lnkButton.ID = objNode.Attribu tes["id"].Value;
lnkButton.Text =
objNode.Attribu tes["Name"].Value;
lnkButton.Font. Size = 8;
lnkButton.Comma ndName = lnkButton.ID.To String();
lnkButton.Comma ndArgument = postbackUrl;
lnkButton.Comma nd += new
CommandEventHan dler(this.lnkBu tton_Click);
TabHolder.Contr ols.Add(lnkButt on);
}
}
private void lnkButton_Click (object sender, CommandEventArg s e)
{
Response.Write( e.CommandName.T oString());
Response.Write( e.CommandArgume nt.ToString());
// Response.Redire ct(e.CommandArg ument.ToString( )); // fails after
come back and click again
Server.Execute( e.CommandArgume nt.ToString());
// Server.Transfer (Session["url"].ToString());
}
Comment