Click here to Skip to main content
15,886,110 members
Home / Discussions / C#
   

C#

 
GeneralAssociating file types with application Pin
purest_lies22-Nov-03 17:03
purest_lies22-Nov-03 17:03 
GeneralRe: Associating file types with application Pin
Judah Gabriel Himango24-Nov-03 4:26
sponsorJudah Gabriel Himango24-Nov-03 4:26 
GeneralRe: Associating file types with application Pin
Heath Stewart24-Nov-03 4:41
protectorHeath Stewart24-Nov-03 4:41 
GeneralASP.NET - losing click event in dynamic controls Pin
Christian Graus22-Nov-03 13:12
protectorChristian Graus22-Nov-03 13:12 
GeneralRe: ASP.NET - losing click event in dynamic controls Pin
leppie22-Nov-03 16:10
leppie22-Nov-03 16:10 
GeneralRe: ASP.NET - losing click event in dynamic controls Pin
Christian Graus22-Nov-03 22:36
protectorChristian Graus22-Nov-03 22:36 
GeneralRe: ASP.NET - losing click event in dynamic controls Pin
Nick Parker23-Nov-03 3:14
protectorNick Parker23-Nov-03 3:14 
GeneralRe: ASP.NET - losing click event in dynamic controls Pin
Christian Graus23-Nov-03 10:13
protectorChristian Graus23-Nov-03 10:13 
There's a lot of it, but I'll try to post the essence of it.

I've got a Wizard class, which simply contains ascx files, each of which is a page in my wizard. It has a method called LoadControl which loads the wizard page into a placeholder on the page. This method takes a boolean flag, it is called in OnInit to load the control so that ViewState is restored, then called again in PageLoad, where it also sets up navigation buttons based on methods defined in the Interface that the wizard pages must impliment. I've looked at the HTML to ensure that the ID's are the same every time, and put in code to make sure that there are no automatically generated IDs anywhere. The current page ID is stored in viewstate, and the events that increment this are also working fine. It works really nicely, it loads the old page, then stores the values in the page into viewstate, then the event is fired and the new page is loaded, and any state restored. The problem comes with another control I've created, which is itself a composite of two controls we've written. My control binds these two controls to work as a particular view to browse our database, and a button that causes the view to flip between the two controls. This button is the event that is never fired in C#, although when I found an example in VB on the Visual Studio magazine site, it works fine. Porting it to C# also leaves me with events that don't fire. When Visual Studio finally wakes up from sorting out source control, I'll post some code.

The control gets loaded in my WizardControl like this:

override protected void LoadViewState(object savedState)
{
if (savedState != null)
{
base.LoadViewState(savedState);

LoadControl(false);
}
}

and then like this:

private void Page_Load(object sender, System.EventArgs e)
{
if (wizardControl.Controls.Count > 0)
{
IWizardPage wizardPage = wizardControl.Controls[0] as IWizardPage;

if (wizardPage != null)
{
pageData[wizardPage.PageName] = wizardPage.GetPageData();
Session[cPageData] = pageData;
}
}

LoadControl(true);
RestorePageData();
}



Christian

I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
GeneralUpdate - I am an idiot Pin
Christian Graus23-Nov-03 11:30
protectorChristian Graus23-Nov-03 11:30 
QuestionFile Dialog in Web Forms ?? Pin
Rostrox22-Nov-03 12:42
Rostrox22-Nov-03 12:42 
AnswerRe: File Dialog in Web Forms ?? Pin
Tomas Petricek22-Nov-03 13:00
Tomas Petricek22-Nov-03 13:00 
GeneralPixel format conversion Pin
Broken God22-Nov-03 7:35
Broken God22-Nov-03 7:35 
QuestionCMD? Pin
Azel Low22-Nov-03 5:30
Azel Low22-Nov-03 5:30 
AnswerRe: CMD? Pin
leppie22-Nov-03 6:19
leppie22-Nov-03 6:19 
GeneralRe: CMD? Pin
Azel Low22-Nov-03 7:21
Azel Low22-Nov-03 7:21 
GeneralMR. Heath Stewart come in please Pin
nakey_yang22-Nov-03 2:21
nakey_yang22-Nov-03 2:21 
GeneralRe: MR. Heath Stewart come in please Pin
Heath Stewart22-Nov-03 4:15
protectorHeath Stewart22-Nov-03 4:15 
GeneralRe: MR. Heath Stewart come in please Pin
nakey_yang22-Nov-03 15:26
nakey_yang22-Nov-03 15:26 
GeneralRe: MR. Heath Stewart come in please Pin
Heath Stewart24-Nov-03 4:15
protectorHeath Stewart24-Nov-03 4:15 
GeneralRe: MR. Heath Stewart come in please Pin
nakey_yang24-Nov-03 20:02
nakey_yang24-Nov-03 20:02 
GeneralRe: MR. Heath Stewart come in please Pin
Heath Stewart25-Nov-03 2:57
protectorHeath Stewart25-Nov-03 2:57 
GeneralRe: MR. Heath Stewart come in please Pin
nakey_yang26-Nov-03 22:03
nakey_yang26-Nov-03 22:03 
GeneralRe: MR. Heath Stewart come in please Pin
Heath Stewart28-Nov-03 3:30
protectorHeath Stewart28-Nov-03 3:30 
GeneralRe: MR. Heath Stewart come in please Pin
nakey_yang1-Dec-03 14:57
nakey_yang1-Dec-03 14:57 
GeneralRe: MR. Heath Stewart come in please Pin
Heath Stewart1-Dec-03 18:27
protectorHeath Stewart1-Dec-03 18:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.