protected void btnqReset_Click(object sender, EventArgs e)
{
try
{
ContentPlaceHolder childMasterContent = (ContentPlaceHolder)Page.Form.FindControl("ParentMasterContent").FindControl("ChildMasterContent");
Control ctrlForm = childMasterContent.FindControl("upnlQueryMoreCriteria").FindControl("pnlQueryMoreCriteria");
Control[] queryControls = { ctrlForm };
for (int i = 0; i < 1; i++)
{
if (queryControls[i].Controls != null)
{
foreach (Control ct in queryControls[i].Controls)
{
if (ct.GetType().ToString().Equals("System.Web.UI.WebControls.TextBox"))
{
((TextBox)ct).Text = "";
}
}
}
}
}
catch (Exception ex)
{
log.Error("Unable to reset query criteria: " + ex.Message + ex.StackTrace);
}
}
Programming Journal C#, Java, SQL and to a lesser extent HTML, CSS, XML, and regex. I made this so other programmers could benefit from my experience.
Monday, February 18, 2008
Drilling down a nested master page in ASP.NET to reset a form
Here is an example of drilling down a master page in ASP.NET to reset a form's TextBox controls:
Subscribe to:
Post Comments (Atom)
Blog Archive
-
▼
2008
(54)
-
▼
February
(13)
- Lazy Load Panel Courtesy of TabContainer and Updat...
- Simple and Complex Drilldown for ASP.Net Objects
- Web User Control Library error
- Prevent RadioButtonList from forcing a line break
- Using Web.config hash for variables using add, key...
- Drilling down a nested master page in ASP.NET to r...
- Intercepting return in list menu items in ASP.NET
- FindContol Solution to add Javascript to a control...
- How to show and hide CalendarExtender and Collapsi...
- Understanding Default Values for User Web Controls
- Creating a ListItemCollection Template User Control
- Installing CA Anti-virus with error on open
- Web Control IDs INamingContainer to avoid duplicat...
-
▼
February
(13)
No comments:
Post a Comment