Showing posts with label create. Show all posts
Showing posts with label create. Show all posts

Saturday, March 31, 2012

Strande inheritance problem

I have two classes, one called frame1 and the other frame2.

In frame2 i import the frame1, and i also create an instance of it.

The problem is that in class frame1 i have an control declared:

Public WithEvents labelNameLogin As System.Web.UI.WebControls.Label

And when a try for eg, access to it a get an error:

If vObjFrameBoard.labelNameLogin.Text = "" Then -- error

'some code

Exit Sub

error:Object reference not set to an instance of an object

But if a try to access to an of its variables, declared as public a have no problem.
So where is the problem.

Thanks in advanceDoesnt anybody know how to solve this. I really need your help.
Thx
Thx for your help anyway.

Here is the soluction for the problem i was having.

Public WithEvents TextBox1 As System.Web.UI.WebControls.TextBox = New System.Web.UI.WebControls.TextBox

i tought the instance was done automatically, like when building an stand alone application.

Strange Behavior for Pages Named Default.aspx

I have several asp.net 2.0 apps written in VS2005 in C#. For each one,
I like to create and track page view events, increment counters, etc.
I do this in a block on each page, like this...
protected void Page_Load(object sender, EventArgs e)
{
if(!this.Page.IsPostBack)
{
Event.Write(EventSource.UserActivity,EventType.Informational,"My
event text");
Counter.Hit(WebPage.MyPage);
}
}
Now, for the problem. I noticed that many events are being written
twice, and many counters are being incremented twice when viewing the
page only once. When I set a breakpoint inside the code block above,
for any page named "Default.aspx" (no matter where it is in the folder
structure) the lines inside the code block execute twice. If I rename
the page to something else, they execute only once, as expected.
Does anyone know what causes this? How can I fix it?Hi Joey,
Seems page events are fired twice because event handler is assigned two
times - by the AutoWireupEvent directive and by your code by adding the
handler explicitely (vb.net AddHandler or Handles clauses)
Milosz
"Joey" wrote:

> I have several asp.net 2.0 apps written in VS2005 in C#. For each one,
> I like to create and track page view events, increment counters, etc.
> I do this in a block on each page, like this...
> protected void Page_Load(object sender, EventArgs e)
> {
> if(!this.Page.IsPostBack)
> {
> Event.Write(EventSource.UserActivity,EventType.Informational,"My
> event text");
> Counter.Hit(WebPage.MyPage);
> }
> }
> Now, for the problem. I noticed that many events are being written
> twice, and many counters are being incremented twice when viewing the
> page only once. When I set a breakpoint inside the code block above,
> for any page named "Default.aspx" (no matter where it is in the folder
> structure) the lines inside the code block execute twice. If I rename
> the page to something else, they execute only once, as expected.
> Does anyone know what causes this? How can I fix it?
>
On Jun 27, 5:38 pm, Milosz Skalecki [MCAD] <mily...@.DONTLIKESPAMwp.pl>
wrote:
> Hi Joey,
> Seems page events are fired twice because event handler is assigned two
> times - by the AutoWireupEvent directive and by your code by adding the
> handler explicitely (vb.net AddHandler or Handles clauses)
> --
> Milosz
>
> "Joey" wrote:
>
>
>
> - Show quoted text -
My code does not explicitly assign any event handlers.
Hi again Joey,
I hope you are well. Could you please paste both aspx page and code beside
so we could have a look?
--
Milosz
"Joey" wrote:

> On Jun 27, 5:38 pm, Milosz Skalecki [MCAD] <mily...@.DONTLIKESPAMwp.pl>
> wrote:
> My code does not explicitly assign any event handlers.
>

Strange Behavior for Pages Named Default.aspx

I have several asp.net 2.0 apps written in VS2005 in C#. For each one,
I like to create and track page view events, increment counters, etc.
I do this in a block on each page, like this...

protected void Page_Load(object sender, EventArgs e)
{
if(!this.Page.IsPostBack)
{
Event.Write(EventSource.UserActivity,EventType.Inf ormational,"My
event text");
Counter.Hit(WebPage.MyPage);
}
}

Now, for the problem. I noticed that many events are being written
twice, and many counters are being incremented twice when viewing the
page only once. When I set a breakpoint inside the code block above,
for any page named "Default.aspx" (no matter where it is in the folder
structure) the lines inside the code block execute twice. If I rename
the page to something else, they execute only once, as expected.

Does anyone know what causes this? How can I fix it?Hi Joey,

Seems page events are fired twice because event handler is assigned two
times - by the AutoWireupEvent directive and by your code by adding the
handler explicitely (vb.net AddHandler or Handles clauses)

--
Milosz

"Joey" wrote:

Quote:

Originally Posted by

I have several asp.net 2.0 apps written in VS2005 in C#. For each one,
I like to create and track page view events, increment counters, etc.
I do this in a block on each page, like this...
>
protected void Page_Load(object sender, EventArgs e)
{
if(!this.Page.IsPostBack)
{
Event.Write(EventSource.UserActivity,EventType.Inf ormational,"My
event text");
Counter.Hit(WebPage.MyPage);
}
}
>
Now, for the problem. I noticed that many events are being written
twice, and many counters are being incremented twice when viewing the
page only once. When I set a breakpoint inside the code block above,
for any page named "Default.aspx" (no matter where it is in the folder
structure) the lines inside the code block execute twice. If I rename
the page to something else, they execute only once, as expected.
>
Does anyone know what causes this? How can I fix it?
>
>


On Jun 27, 5:38 pm, Milosz Skalecki [MCAD] <mily...@.DONTLIKESPAMwp.pl>
wrote:

Quote:

Originally Posted by

Hi Joey,
>
Seems page events are fired twice because event handler is assigned two
times - by the AutoWireupEvent directive and by your code by adding the
handler explicitely (vb.net AddHandler or Handles clauses)
>
--
Milosz
>
>
>
"Joey" wrote:

Quote:

Originally Posted by

I have several asp.net 2.0 apps written in VS2005 in C#. For each one,
I like to create and track page view events, increment counters, etc.
I do this in a block on each page, like this...


>

Quote:

Originally Posted by

protected void Page_Load(object sender, EventArgs e)
{
if(!this.Page.IsPostBack)
{
Event.Write(EventSource.UserActivity,EventType.Inf ormational,"My
event text");
Counter.Hit(WebPage.MyPage);
}
}


>

Quote:

Originally Posted by

Now, for the problem. I noticed that many events are being written
twice, and many counters are being incremented twice when viewing the
page only once. When I set a breakpoint inside the code block above,
for any page named "Default.aspx" (no matter where it is in the folder
structure) the lines inside the code block execute twice. If I rename
the page to something else, they execute only once, as expected.


>

Quote:

Originally Posted by

Does anyone know what causes this? How can I fix it?- Hide quoted text -


>
- Show quoted text -


My code does not explicitly assign any event handlers.
Hi again Joey,

I hope you are well. Could you please paste both aspx page and code beside
so we could have a look?
--
Milosz

"Joey" wrote:

Quote:

Originally Posted by

On Jun 27, 5:38 pm, Milosz Skalecki [MCAD] <mily...@.DONTLIKESPAMwp.pl>
wrote:

Quote:

Originally Posted by

Hi Joey,

Seems page events are fired twice because event handler is assigned two
times - by the AutoWireupEvent directive and by your code by adding the
handler explicitely (vb.net AddHandler or Handles clauses)

--
Milosz

"Joey" wrote:

Quote:

Originally Posted by

I have several asp.net 2.0 apps written in VS2005 in C#. For each one,
I like to create and track page view events, increment counters, etc.
I do this in a block on each page, like this...


Quote:

Originally Posted by

protected void Page_Load(object sender, EventArgs e)
{
if(!this.Page.IsPostBack)
{
Event.Write(EventSource.UserActivity,EventType.Inf ormational,"My
event text");
Counter.Hit(WebPage.MyPage);
}
}


Quote:

Originally Posted by

Now, for the problem. I noticed that many events are being written
twice, and many counters are being incremented twice when viewing the
page only once. When I set a breakpoint inside the code block above,
for any page named "Default.aspx" (no matter where it is in the folder
structure) the lines inside the code block execute twice. If I rename
the page to something else, they execute only once, as expected.


Quote:

Originally Posted by

Does anyone know what causes this? How can I fix it?- Hide quoted text -


- Show quoted text -


>
My code does not explicitly assign any event handlers.
>
>

Saturday, March 24, 2012

Strange exception

Copied from microsoft.public.cmserver.general
(http://communities2.microsoft.com/c...13-756f24b06d79)
Hello,
When i try to create a new page from a new template i get the exception belo
w.
Anyone have any directions on what i should look for?
The template path is correct and the project compiles ok.
When i run the project in debug no breakpoints in my template are hit.
/Johan
Exception: System.Web.HttpException
Message: External component has thrown an exception.
Source: System.Web
at System.Web.UI.TemplateParser.GetParserCacheItemInternal(Boolean
fCreateIfNotFound)
at System.Web.UI.TemplateParser.GetParserCacheItemWithNewConfigPath()
at System.Web.UI.TemplateParser.GetParserCacheItem()
at
System.Web.UI.TemplateControlParser.CompileAndGetParserCacheItem(String
virtualPath, String inputFile, HttpContext context)
at System.Web.UI.TemplateControlParser.GetCompiledInstance(String
virtualPath, String inputFile, HttpContext context)
at System.Web.UI.PageParser.GetCompiledPageInstanceInternal(String
virtualPath, String inputFile, HttpContext context)
at System.Web.UI.PageHandlerFactory.GetHandler(HttpContext context,
String requestType, String url, String path)
at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String
requestType, String path, String pathTranslated, Boolean useAppConfig)
at
System.Web.MapHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep
.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously)
Nested Exception
Exception: System.Web.HttpCompileException
Message: External component has thrown an exception.
Source: System.Web
at
System.Web.Compilation.BaseCompiler.ThrowIfCompilerErrors(CompilerResults
results, CodeDomProvider codeProvider, CodeCompileUnit sourceData, String
sourceFile, String sourceString)
at System.Web.Compilation.BaseCompiler.GetCompiledType()
at System.Web.UI.PageParser.CompileIntoType()
at System.Web.UI.TemplateParser.GetParserCacheItemThroughCompilation()I know this probably doesn't help much, but I see this kind of exception all
the time when using the CSK. The CSK throws these exceptions as part of its
normal operation and continues on as per normal. I have a routine which
emails me exception details from a CSK site and I receive an email for
almost every page visited by a user.
- Paul Glavich
Microsoft MVP - ASP.NET
"Johan Neidenmark" <JohanNeidenmark@.discussions.microsoft.com> wrote in
message news:A0664C49-8947-4500-A5D8-7C6CE75791DB@.microsoft.com...
> Copied from microsoft.public.cmserver.general
>
(http://communities2.microsoft.com/c...us/default.aspx
?dg=microsoft.public.cmserver.general&mid=68d413a9-0f0e-458c-b913-756f24b06d
79)
> Hello,
> When i try to create a new page from a new template i get the exception
below.
> Anyone have any directions on what i should look for?
> The template path is correct and the project compiles ok.
> When i run the project in debug no breakpoints in my template are hit.
> /Johan
> Exception: System.Web.HttpException
> Message: External component has thrown an exception.
> Source: System.Web
> at System.Web.UI.TemplateParser.GetParserCacheItemInternal(Boolean
> fCreateIfNotFound)
> at System.Web.UI.TemplateParser.GetParserCacheItemWithNewConfigPath()
> at System.Web.UI.TemplateParser.GetParserCacheItem()
> at
> System.Web.UI.TemplateControlParser.CompileAndGetParserCacheItem(String
> virtualPath, String inputFile, HttpContext context)
> at System.Web.UI.TemplateControlParser.GetCompiledInstance(String
> virtualPath, String inputFile, HttpContext context)
> at System.Web.UI.PageParser.GetCompiledPageInstanceInternal(String
> virtualPath, String inputFile, HttpContext context)
> at System.Web.UI.PageHandlerFactory.GetHandler(HttpContext context,
> String requestType, String url, String path)
> at System.Web.HttpApplication.MapHttpHandler(HttpContext context,
String
> requestType, String path, String pathTranslated, Boolean useAppConfig)
> at
>
System.Web.MapHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep
.Execute()
> at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
> completedSynchronously)
> Nested Exception
> Exception: System.Web.HttpCompileException
> Message: External component has thrown an exception.
> Source: System.Web
> at
> System.Web.Compilation.BaseCompiler.ThrowIfCompilerErrors(CompilerResults
> results, CodeDomProvider codeProvider, CodeCompileUnit sourceData, String
> sourceFile, String sourceString)
> at System.Web.Compilation.BaseCompiler.GetCompiledType()
> at System.Web.UI.PageParser.CompileIntoType()
> at System.Web.UI.TemplateParser.GetParserCacheItemThroughCompilation()
>

Strange exception

Copied from microsoft.public.cmserver.general
(http://communities2.microsoft.com/c...13-756f24b06d79)

Hello,

When i try to create a new page from a new template i get the exception below.
Anyone have any directions on what i should look for?
The template path is correct and the project compiles ok.
When i run the project in debug no breakpoints in my template are hit.

/Johan

Exception: System.Web.HttpException
Message: External component has thrown an exception.
Source: System.Web
at System.Web.UI.TemplateParser.GetParserCacheItemInt ernal(Boolean
fCreateIfNotFound)
at System.Web.UI.TemplateParser.GetParserCacheItemWit hNewConfigPath()
at System.Web.UI.TemplateParser.GetParserCacheItem()
at
System.Web.UI.TemplateControlParser.CompileAndGetP arserCacheItem(String
virtualPath, String inputFile, HttpContext context)
at System.Web.UI.TemplateControlParser.GetCompiledIns tance(String
virtualPath, String inputFile, HttpContext context)
at System.Web.UI.PageParser.GetCompiledPageInstanceIn ternal(String
virtualPath, String inputFile, HttpContext context)
at System.Web.UI.PageHandlerFactory.GetHandler(HttpCo ntext context,
String requestType, String url, String path)
at System.Web.HttpApplication.MapHttpHandler(HttpCont ext context, String
requestType, String path, String pathTranslated, Boolean useAppConfig)
at
System.Web.MapHandlerExecutionStep.System.Web.Http Application+IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously)

Nested Exception

Exception: System.Web.HttpCompileException
Message: External component has thrown an exception.
Source: System.Web
at
System.Web.Compilation.BaseCompiler.ThrowIfCompile rErrors(CompilerResults
results, CodeDomProvider codeProvider, CodeCompileUnit sourceData, String
sourceFile, String sourceString)
at System.Web.Compilation.BaseCompiler.GetCompiledTyp e()
at System.Web.UI.PageParser.CompileIntoType()
at System.Web.UI.TemplateParser.GetParserCacheItemThr oughCompilation()I know this probably doesn't help much, but I see this kind of exception all
the time when using the CSK. The CSK throws these exceptions as part of its
normal operation and continues on as per normal. I have a routine which
emails me exception details from a CSK site and I receive an email for
almost every page visited by a user.

--
- Paul Glavich
Microsoft MVP - ASP.NET

"Johan Neidenmark" <JohanNeidenmark@.discussions.microsoft.com> wrote in
message news:A0664C49-8947-4500-A5D8-7C6CE75791DB@.microsoft.com...
> Copied from microsoft.public.cmserver.general
(http://communities2.microsoft.com/c...us/default.aspx
?dg=microsoft.public.cmserver.general&mid=68d413a9-0f0e-458c-b913-756f24b06d
79)
> Hello,
> When i try to create a new page from a new template i get the exception
below.
> Anyone have any directions on what i should look for?
> The template path is correct and the project compiles ok.
> When i run the project in debug no breakpoints in my template are hit.
> /Johan
> Exception: System.Web.HttpException
> Message: External component has thrown an exception.
> Source: System.Web
> at System.Web.UI.TemplateParser.GetParserCacheItemInt ernal(Boolean
> fCreateIfNotFound)
> at System.Web.UI.TemplateParser.GetParserCacheItemWit hNewConfigPath()
> at System.Web.UI.TemplateParser.GetParserCacheItem()
> at
> System.Web.UI.TemplateControlParser.CompileAndGetP arserCacheItem(String
> virtualPath, String inputFile, HttpContext context)
> at System.Web.UI.TemplateControlParser.GetCompiledIns tance(String
> virtualPath, String inputFile, HttpContext context)
> at System.Web.UI.PageParser.GetCompiledPageInstanceIn ternal(String
> virtualPath, String inputFile, HttpContext context)
> at System.Web.UI.PageHandlerFactory.GetHandler(HttpCo ntext context,
> String requestType, String url, String path)
> at System.Web.HttpApplication.MapHttpHandler(HttpCont ext context,
String
> requestType, String path, String pathTranslated, Boolean useAppConfig)
> at
System.Web.MapHandlerExecutionStep.System.Web.Http Application+IExecutionStep
..Execute()
> at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
> completedSynchronously)
> Nested Exception
> Exception: System.Web.HttpCompileException
> Message: External component has thrown an exception.
> Source: System.Web
> at
> System.Web.Compilation.BaseCompiler.ThrowIfCompile rErrors(CompilerResults
> results, CodeDomProvider codeProvider, CodeCompileUnit sourceData, String
> sourceFile, String sourceString)
> at System.Web.Compilation.BaseCompiler.GetCompiledTyp e()
> at System.Web.UI.PageParser.CompileIntoType()
> at System.Web.UI.TemplateParser.GetParserCacheItemThr oughCompilation()

Thursday, March 22, 2012

Strange file access problem

I have an .NET 2.0 web application that I am using to create, read,
encrypt, and delete an XML file. It all works great when I am testing
it on the local machine that I am using as a web server, in debug and
release using impersonation, but when I use a different computer to log

on to the same page, using the same user id, it returns with an
UnauthorizedAccessException saying that I do not have access to the
file. The file is not on either machine. The path I use is
\\<server>\<folder>\<folder>\setup.xml and I have already tried it
mapped as z:\f<folder>\<folder>\setup.xml , but when I use the machine
that is running IIS, neither paths gave me any trouble at all. I have
also checked System.Security.Principal.WindowsIdentity.GetCurre nt()
while using both and, as far as I can tell, they are identical except
that the one ran from the IIS machine has the extra group "LOCAL", and
the remote attempts don't, but that seems unimportant. (at least I
hope it is because I have tried to add the current user to the role
"LOCAL", but can't get it to work)

Any help anyone can share would be greatly appreciated, I thank you in
advance.

-Sethbump

strange login occurrence

hey all,

i have an asp.net app and i create a login.aspx page for it, i changed the
web.config to windows forms authentication and deny users="?" for
authorization. i browsed to a page and got redirected to login several times.
that's perfect.

well, i had to run the data adapter wizard again to bring in some database
changes i made and now i don't get redirected to the login page when i try to
browse directly to a page.aspx.

any ideas why the login isn't working all of a sudden?
thanks,
rodchari think i may have figured it out. when i delete my cookies it works the way
it should. can you tell how new i am to this?

thanks.

"rodchar" wrote:

> hey all,
> i have an asp.net app and i create a login.aspx page for it, i changed the
> web.config to windows forms authentication and deny users="?" for
> authorization. i browsed to a page and got redirected to login several times.
> that's perfect.
> well, i had to run the data adapter wizard again to bring in some database
> changes i made and now i don't get redirected to the login page when i try to
> browse directly to a page.aspx.
> any ideas why the login isn't working all of a sudden?
> thanks,
> rodchar

strange login occurrence

hey all,
i have an asp.net app and i create a login.aspx page for it, i changed the
web.config to windows forms authentication and deny users="?" for
authorization. i browsed to a page and got redirected to login several times
.
that's perfect.
well, i had to run the data adapter wizard again to bring in some database
changes i made and now i don't get redirected to the login page when i try t
o
browse directly to a page.aspx.
any ideas why the login isn't working all of a sudden?
thanks,
rodchari think i may have figured it out. when i delete my cookies it works the way
it should. can you tell how new i am to this?
thanks.
"rodchar" wrote:

> hey all,
> i have an asp.net app and i create a login.aspx page for it, i changed the
> web.config to windows forms authentication and deny users="?" for
> authorization. i browsed to a page and got redirected to login several tim
es.
> that's perfect.
> well, i had to run the data adapter wizard again to bring in some database
> changes i made and now i don't get redirected to the login page when i try
to
> browse directly to a page.aspx.
> any ideas why the login isn't working all of a sudden?
> thanks,
> rodchar