Yes you can use this code .. but it will be better to develop your own code .. as you can do this without using graphics(GDI+).
Just create a table from the datagrid (Generate DataTable) and use it
I created a master page and put a treeview control in there on the left side table layout want to use the right side for different pages.
but the problem is i have a textbox and search button above the treeview and the treeview is loaded depending on what search string you type in. then i can click on a treenode and click a button on the top menu called addSubTreeNode - the right content panel should have a few text boxes for adding details of this TreeNode - but when i do this the treeview disappears - i want it to stay how it was on the mainpage.aspx - even when i goto this new addsubtreenode.aspx for adding a subTreeNode. (sort of like if i had frames and the treeview page remained the same - i want it to be in the same state as it was on mainpage.aspx when i natigate to addsubtreenode.aspx) (both these aspx pages are derieved from the master page and the treenode code is on the masterpage)
I ran into this problem for the first time since I was working with .Net framework. You can't get (directly) to the query string of the page if your aspx is contained into a frame. It's possible to get it though the UrlRefferer object and to parse out the string.
I have a C# library created under VS2003 and stored in VSS. I now would like to create a version of that library targeted for the APS.NET 2.0 runtime under VS2005 but I am unable to figure out how to set things up so I can use one codebase stored in VSS. Does anyone have a suggestion on how best to maintain one body of code but compile two separate versions?
Thanks for the reply. I haven't found any way yet either to share teh code between teh two solutions. But I DID find one interesting hack that will allow VS2005 to compile to 1.1 so you could in effect use the same solution to compile versions of both. For those that are interested, here's the URL:
so i also wired up the Click event of the buttons in my control as a failsafe, but they never fire. can anyone please help with this.
the control is huge, so i will try and post the relevant code below.
the control is a message box and i only need to be concerned with the button click events.
protectedoverridevoid OnInit(EventArgs e)
this.GetType(), "DragScript", Page.ClientScript.GetWebResourceUrl(this.GetType(),
foreach (Button button in Buttons)
button.Attributes["onclick"] = Page.ClientScript.GetPostBackEventReference(this, button.Text);
button.Click += new EventHandler(Button_Click);
#region ButtonClicked event
protectedvoid Button_Click(object sender, EventArgs e)
publicdelegatevoid ButtonClickedHandler(MessageBox sender, ButtonClickedArgs e);
Description("Fired when a button is clicked within the Message Box"),
publicevent ButtonClickedHandler ButtonClicked;
///<summary>/// Fires the MessageBoxButtonClicked event
///</summary>protectedvoid OnButtonClicked(ButtonClickedArgs e)
if (ButtonClicked != null)
// hide the message boxthis.Visible = false;
#region IPostBackEventHandler Members
publicvoid RaisePostBackEvent(string eventArgument)
bool found = false;
Button button = null;
int i = 0;
while (i < Buttons.Count && !found)
Button b = Buttons[i];
if (b.Text == eventArgument)
found = true;
button = b;
if (button != null)
How do you add the child buttons stored in the Buttons collection? Do they get declared between the opening and closing tags of the custom control in the web page? or do you dynamically declare somewhere else?
The first case does not work as you add the dynamic button in the Render method which occurs after the postback event is processed in the control life cycle, so the event hanler does not execute. In the second case, you use the CreateChildControls method to add the child control, and this method makes sure that the child button is added to the control hierarchy before the postback event is processed, so it works. Generally speaking, you need to make sure that the child control is added to the parent (more general, the control hierarchy) and the handler is wired up to the event before the event is processed in order to make it run properly.
Last Visit: 31-Dec-99 18:00 Last Update: 24-Sep-23 22:02