N
nottheface
I have a chunk of code I'm writing in a C# code behind. Not sure if
this is the right place to post, but I'm hoping someone has come across
this before...
I have on a page a pair of drop down boxes. Based on the selection
made in one drop down, the second is enabled or disabled.
The code actually works just fine - as long as I put a break point on
the line
if (UserInRole("HR Resolution Admins") == true)
Once it stops, I can hit F5 to continue without stopping again, and it
all works as expected.
If I remove my breakpoints, then the above line is never equal true,
even though I am logged in as the same user. In fact, if I start the
project without the break (where it doesn't work) and add the break in
after I have already loaded the page, it starts to work. Taking the
break back out, of course, means that it stops to work again.
I'm considering simply loading Visual Studio .net on all the users
computers and making them run the application in debug mode - but I
don't think management will go for it...
Really, really frustrating.
Steve.
private void ddlStatus_SelectedIndexChanged(object sender,
System.EventArgs e)
{
try
{
// User changed the selected status, need to repopulate the meeting
date drop down list
// if they selected a committee.
resolutionsWS.Resolutions ws = new resolutionsWS.Resolutions();
ws.Credentials = System.Net.CredentialCache.DefaultCredentials;
// HR Special Case:
// IF user is HR Resolution Admin
if (UserInRole("HR Resolution Admins") == true)
{
// and status is Personnel THEN user can select meeting
if ( Int32.Parse(ddlStatus.SelectedValue) == 16 )
{
//submitted and using an HR template
ddlMeetingDates.Enabled = true;
}
else
{
//NOT an HR template
ddlMeetingDates.Enabled = false;
}
}
else
{
hdnDebugInfo.Text += "Elsed Out";
}
ddlMeetingDates.DataSource =
ws.GetCommitteeMeetingDates(Int32.Parse(ddlStatus.SelectedValue));
ddlMeetingDates.DataTextField = "MeetingDate";
ddlMeetingDates.DataValueField = "MeetingDate";
}
catch (Exception ex)
{
throw ex;
}
finally
{
Page.DataBind();
}
}
this is the right place to post, but I'm hoping someone has come across
this before...
I have on a page a pair of drop down boxes. Based on the selection
made in one drop down, the second is enabled or disabled.
The code actually works just fine - as long as I put a break point on
the line
if (UserInRole("HR Resolution Admins") == true)
Once it stops, I can hit F5 to continue without stopping again, and it
all works as expected.
If I remove my breakpoints, then the above line is never equal true,
even though I am logged in as the same user. In fact, if I start the
project without the break (where it doesn't work) and add the break in
after I have already loaded the page, it starts to work. Taking the
break back out, of course, means that it stops to work again.
I'm considering simply loading Visual Studio .net on all the users
computers and making them run the application in debug mode - but I
don't think management will go for it...
Really, really frustrating.
Steve.
private void ddlStatus_SelectedIndexChanged(object sender,
System.EventArgs e)
{
try
{
// User changed the selected status, need to repopulate the meeting
date drop down list
// if they selected a committee.
resolutionsWS.Resolutions ws = new resolutionsWS.Resolutions();
ws.Credentials = System.Net.CredentialCache.DefaultCredentials;
// HR Special Case:
// IF user is HR Resolution Admin
if (UserInRole("HR Resolution Admins") == true)
{
// and status is Personnel THEN user can select meeting
if ( Int32.Parse(ddlStatus.SelectedValue) == 16 )
{
//submitted and using an HR template
ddlMeetingDates.Enabled = true;
}
else
{
//NOT an HR template
ddlMeetingDates.Enabled = false;
}
}
else
{
hdnDebugInfo.Text += "Elsed Out";
}
ddlMeetingDates.DataSource =
ws.GetCommitteeMeetingDates(Int32.Parse(ddlStatus.SelectedValue));
ddlMeetingDates.DataTextField = "MeetingDate";
ddlMeetingDates.DataValueField = "MeetingDate";
}
catch (Exception ex)
{
throw ex;
}
finally
{
Page.DataBind();
}
}