R
Rob
I have the following code that works well when I run it on localhost,
but when I browse to it from another computer i get the error message
below.
Dim objUser As New DirectoryEntry("LDAP://cn=myName,ou=Tech
Support,dc=mydomain,dc=com")
Try
objUser.Invoke("ChangePassword", Oldpass.Text,
newpass.Text)
objUser.CommitChanges()
Catch ex As Exception
Response.Write(ex.InnerException.Message)
End Try
Here's the error I Get. It's like ex is no longer exposed. What can I
do to handle different types of errors if I cannot use ex?
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not
set to an instance of an object.
Source Error:
Line 35: objUser.CommitChanges()
Line 36: Catch ex As Exception
Line 37: Response.Write(ex.InnerException.Message)
Line 38: End Try
Line 39:
Source File: C:\Inetpub\wwwroot\WebApplication3\WebForm1.aspx.vb
Line: 37
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an
object.]
WebApplication3.WebForm1.Button1_Click(Object sender, EventArgs e)
in C:\Inetpub\wwwroot\WebApplication3\WebForm1.aspx.vb:37
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
+33
System.Web.UI.Page.ProcessRequestMain() +1277
but when I browse to it from another computer i get the error message
below.
Dim objUser As New DirectoryEntry("LDAP://cn=myName,ou=Tech
Support,dc=mydomain,dc=com")
Try
objUser.Invoke("ChangePassword", Oldpass.Text,
newpass.Text)
objUser.CommitChanges()
Catch ex As Exception
Response.Write(ex.InnerException.Message)
End Try
Here's the error I Get. It's like ex is no longer exposed. What can I
do to handle different types of errors if I cannot use ex?
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not
set to an instance of an object.
Source Error:
Line 35: objUser.CommitChanges()
Line 36: Catch ex As Exception
Line 37: Response.Write(ex.InnerException.Message)
Line 38: End Try
Line 39:
Source File: C:\Inetpub\wwwroot\WebApplication3\WebForm1.aspx.vb
Line: 37
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an
object.]
WebApplication3.WebForm1.Button1_Click(Object sender, EventArgs e)
in C:\Inetpub\wwwroot\WebApplication3\WebForm1.aspx.vb:37
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
+33
System.Web.UI.Page.ProcessRequestMain() +1277