473,471 Members | 2,613 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Problem while NOT debugging

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();
}
}

Aug 4 '06 #1
4 1284
Unless your ASP.Net application runs on a web server that requires a login
(anonymous access disabled), your user will always be the Anonymous Internet
User account on that machine. Which account this is depends on the Operating
System used by the web server.

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

Who is Mighty Abbott? A twin-turret scalawag.

<no********@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
>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();
}
}

Aug 4 '06 #2
Thanks for the reply, Kevin.

When I say logged on - I mean logged into Sharepoint as a specific user
who is a member of a specific role. This app is actually running in a
Sharepoint page viewer web part. Who is logged in is one of the
factors that determines whether or not they can use the second control.
I just went through this with another programmer (the 4th one besides
me to look at it) and his suggestion was to look deeper into the
crystal ball of impersonation that is taking place in the call to the
UserInRole function. In there I am impersonating the administrator in
order to look at the roles and thus determine if the logged on user is
a member of the pertinent role.

However, any advice on the .net .asp .c# side of things is well and
truely appreciated.

Steve.

Kevin Spencer wrote:
Unless your ASP.Net application runs on a web server that requires a login
(anonymous access disabled), your user will always be the Anonymous Internet
User account on that machine. Which account this is depends on the Operating
System used by the web server.

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

Who is Mighty Abbott? A twin-turret scalawag.

<no********@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
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();
}
}
Aug 4 '06 #3
Hi Steve,

You're definitely posting to the WRONG newsgroup for this topic! While yes,
SharePoint is an ASP.Net application, it is so proprietary and low-level
that you can't really understand it in the same way that you would
understand any other ASP.Net application. Here are some newsgroups that
should help:

microsoft.public.sharepoint.general
microsoft.public.sharepoint.development_and_progra mming
microsoft.public.sharepoint.portalserver
microsoft.public.sharepoint.portalserver.developme nt
microsoft.public.sharepoint.setup_and_administrati on

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

Who is Mighty Abbott? A twin-turret scalawag.

<no********@gmail.comwrote in message
news:11**********************@m79g2000cwm.googlegr oups.com...
Thanks for the reply, Kevin.

When I say logged on - I mean logged into Sharepoint as a specific user
who is a member of a specific role. This app is actually running in a
Sharepoint page viewer web part. Who is logged in is one of the
factors that determines whether or not they can use the second control.
I just went through this with another programmer (the 4th one besides
me to look at it) and his suggestion was to look deeper into the
crystal ball of impersonation that is taking place in the call to the
UserInRole function. In there I am impersonating the administrator in
order to look at the roles and thus determine if the logged on user is
a member of the pertinent role.

However, any advice on the .net .asp .c# side of things is well and
truely appreciated.

Steve.

Kevin Spencer wrote:
>Unless your ASP.Net application runs on a web server that requires a
login
(anonymous access disabled), your user will always be the Anonymous
Internet
User account on that machine. Which account this is depends on the
Operating
System used by the web server.

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

Who is Mighty Abbott? A twin-turret scalawag.

<no********@gmail.comwrote in message
news:11**********************@i42g2000cwa.googleg roups.com...
>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();
}
}

Aug 4 '06 #4
Yeah. My main purpose for posting here was to learn more about why
something might work fine while debugging but failed when running flat
out.

I still don't know why that is the case, but maybe it has something to
do with the sharepoint object model.

or the phase of the moon.

Thanks,
Steve.
Kevin Spencer wrote:
Hi Steve,

You're definitely posting to the WRONG newsgroup for this topic! While yes,
SharePoint is an ASP.Net application, it is so proprietary and low-level
that you can't really understand it in the same way that you would
understand any other ASP.Net application. Here are some newsgroups that
should help:

microsoft.public.sharepoint.general
microsoft.public.sharepoint.development_and_progra mming
microsoft.public.sharepoint.portalserver
microsoft.public.sharepoint.portalserver.developme nt
microsoft.public.sharepoint.setup_and_administrati on

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

Who is Mighty Abbott? A twin-turret scalawag.

<no********@gmail.comwrote in message
news:11**********************@m79g2000cwm.googlegr oups.com...
Thanks for the reply, Kevin.

When I say logged on - I mean logged into Sharepoint as a specific user
who is a member of a specific role. This app is actually running in a
Sharepoint page viewer web part. Who is logged in is one of the
factors that determines whether or not they can use the second control.
I just went through this with another programmer (the 4th one besides
me to look at it) and his suggestion was to look deeper into the
crystal ball of impersonation that is taking place in the call to the
UserInRole function. In there I am impersonating the administrator in
order to look at the roles and thus determine if the logged on user is
a member of the pertinent role.

However, any advice on the .net .asp .c# side of things is well and
truely appreciated.

Steve.

Kevin Spencer wrote:
Unless your ASP.Net application runs on a web server that requires a
login
(anonymous access disabled), your user will always be the Anonymous
Internet
User account on that machine. Which account this is depends on the
Operating
System used by the web server.

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

Who is Mighty Abbott? A twin-turret scalawag.

<no********@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
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();
}
}
Aug 4 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Stephanie | last post by:
I have a problem that I am trying to solve. We have a huge product with a whole lot of ASP and VB code. VB code is all ActiveX dlls which are used by ASP app. When I attempt to add features or fix...
10
by: Matt Fielder | last post by:
I have developed a custom control to be used in my application. My application includes a form designer, so the control can be hosted while designmode for the control is either true or false,...
2
by: PJ | last post by:
I'm at the end of my rope, I've tried everything I can think of and, while the problem is all over google, no answer has worked for me. I'm getting the following error while trying to start my web...
1
by: Günther Rühmann | last post by:
Hi, I´m not sure if i´m right int this group... My problem: I made a vb .net application that reads from AD via System.Directoryservices.Directoryentry. The appliocation enumerates group...
0
by: Tequila | last post by:
Here’s the description I’d launched Visual Studio and started to write an application After some time of coding, I wanted to test it. I pressed F5 hopin to run application for debugging. I...
5
by: Segfahlt | last post by:
I need a little help here please. I have 2 win forms user controls in 2 different projects that I'm hosting in 2 different virtual directories. The controls have been test and operate okay in...
3
by: Lambuz | last post by:
Hi all, I've got this problem. I've to implemente a solution like the example in http://support.microsoft.com/default.aspx?scid=kb;EN-US;313891, but I can't configure correctly the example. ...
0
by: Budhi Saputra Prasetya | last post by:
Hi, I still have the same problem with embedding Windows Control. I'll just requote what I posted last time: I managed to create a Windows Form Control and put it on my ASP .NET page. I...
4
by: Vivienne | last post by:
I am using vs 2005 on windows xp. I created a project, named ssps.And when debugging, I set project property->debugging->command argument the way I wanted,like this: -b f: \files f:\files. Then...
2
by: jiang.haiyun | last post by:
Hi, I am having some serious problems with PyQT4, when i run pyqt script, I always get 'Segmentation fault'. the script is simple: ====================== %less qttest.py from PyQt4 import...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.