K
Keithb
A page's Page_Load event contains initialization code (shown below),
intended to execute only once when the page is loaded for the first time.
After page load, the first time the user clicks an Update button, the
initialization code is executed a second time, cancelling out the users
check box entries. Subsequent clicks to the Update button do not execute the
initialization code and everything works properly. What can I do so that
this page initializes only once?
Thanks,
Keith
if (!Page.IsPostBack)
{
EndPointCB.Checked = false;
BusSvcCB.Checked = false;
AppSvcCB.Checked = false;
SampleXmlCB.Checked = false;
if (BindSelectSvcGroupDDL())
{
if (BindSelectSvcVerDDL())
{
String svcGroup = SelectSvcGroupDDL.SelectedItem.Text;
String svcName = FindSvcTB.Text;
String svcVer = SelectSvcVerDDL.SelectedItem.Text;
bool ShowEndPoint = EndPointCB.Checked;
bool ShowBusSvc = BusSvcCB.Checked;
bool ShowAppSvc = AppSvcCB.Checked;
bool ShowSampleXML = SampleXmlCB.Checked;
String UserRole = "None";
BindGrid(svcGroup, svcName, svcVer, UserRole,
ShowEndPoint, ShowBusSvc, ShowAppSvc, ShowSampleXML);
}
}
}
intended to execute only once when the page is loaded for the first time.
After page load, the first time the user clicks an Update button, the
initialization code is executed a second time, cancelling out the users
check box entries. Subsequent clicks to the Update button do not execute the
initialization code and everything works properly. What can I do so that
this page initializes only once?
Thanks,
Keith
if (!Page.IsPostBack)
{
EndPointCB.Checked = false;
BusSvcCB.Checked = false;
AppSvcCB.Checked = false;
SampleXmlCB.Checked = false;
if (BindSelectSvcGroupDDL())
{
if (BindSelectSvcVerDDL())
{
String svcGroup = SelectSvcGroupDDL.SelectedItem.Text;
String svcName = FindSvcTB.Text;
String svcVer = SelectSvcVerDDL.SelectedItem.Text;
bool ShowEndPoint = EndPointCB.Checked;
bool ShowBusSvc = BusSvcCB.Checked;
bool ShowAppSvc = AppSvcCB.Checked;
bool ShowSampleXML = SampleXmlCB.Checked;
String UserRole = "None";
BindGrid(svcGroup, svcName, svcVer, UserRole,
ShowEndPoint, ShowBusSvc, ShowAppSvc, ShowSampleXML);
}
}
}