Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Clear fields in the Wizard's controls
Message
General information
Forum:
ASP.NET
Category:
AJAX
Environment versions
Environment:
ASP.NET
OS:
Windows Server 2003
Database:
MS SQL Server
Miscellaneous
Thread ID:
01296192
Message ID:
01296261
Views:
7
>>Hi everybody,
>>
>>This should be a simple and common question, but I can not make it to work for several days already :(
>>
>>I have a Wizard on a page. When I press the Finish button, I have a link to add a new entry using the same Wizard. The problem is that all the previously added information is still there and I'd like to work with a clean state.
>>
>>I'm not sure how to clear all controls.
>
>You should have access to all of the controls in the wizard, so you could manually just iterate through them and clear their Text property. But it's probably much easier to just use something like: Response.Redirect("/NameOfMyWizardPage.aspx");
>

I'll try that. I was thinking about iterating through Wizard controls using foreach(c as Control in ...)
but c.Clear() didn't work inside the loop. Listing each control explicitly didn't look correct to me.

>That way you're not coming into the page via a postback and the control will be reset.
>
>>
>>Also is there anything like messagebox in ASP.NET?
>>
>
>Not really. You can use JavaScript for this, see: alert() or confirm(). There are also third party controls which simulate this kind of thing (Telerik's Window control has some nice "dialog" style windows). If you need to do this kind of thing after a postback, you can just inject the JavaScript into the page using:
>
>
>string js = "alert('This is an alert!');";
>Page.ClientScript.RegisterClientScriptBlock(typeof(this), "Alert", js, true);
>
>
>Or Page.ClientScript.RegisterStartupScript().
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform