Showing posts with label net. Show all posts
Showing posts with label net. Show all posts

Saturday, March 31, 2012

Storing/Retrieving Objects in the Session

I have a form set up currently so that when someone is added, an object is created with that persons information, and that object is then added to the Session. When the user is done with the form, I have the code setup to mirror the information back on a webpage (when I know it's spewing back the same information I put in, then I'll have it be stored in a database). The problem I am having is that I don't know how to call my toString method of my object from the session.
The class is called Person, and the object is called objPerson, I store it this way:

Session.Add("objPerson", objPerson)

and echo it back to the screen this way:

Response.Write(Session.Item("objPerson"))

The only thing that comes out is the name of the object though, with the namespaces ( COCO.objects.Person ). I tried using

Response.Write( Session.Item( "objPerson.toString()") )

But I had a feeling that wouldn't work, and it didn't. Have I approached this wrong, or am I on the right track here?
Thanks,
DSimmonHi there...

The problem is that you have to sat your item from the session to the Object type of that item, and then you can use it.

Assuming that the class of objPerson is "Person", you would have to do something like this to retreive it:

Person sessionPerson = (Person)Session("Person");

And then use 'sessionPerson' as you want to.

You can use it directly also like this:

((Person)Session("Person")).Name;

Again, assuming you have a "Name" for your "Person" class.

I hope this helps, let me know if you need more info.

Covo
Ahh, so I have to make a storage when I retrieve the object from the session, then recast it to that object type before I use it.
That makes sense, I'll try it now.
Thanks for you help.

David
you're welcome!

Notice that you don't have to make a storage object... If you see the second method I listed, you'll see that you can just cast the session to the object and use it directly.

Story Ads

Hi,

We have all seen them. Those square ads inside of textual content wherethe text wraps around the ad. The ad is about halfway down the text andit floats either left, or right.

What would be the best way to do those kinds of ads? I imagine youcould take the text and count to...let's say 300 characters from theleft, insert the ad and then pick up the text starting at position 301.This seems crude and might cause problems. If the text includes htmltags, position 300 may be an opening, or closing caret, which wouldmess with the formatting.

Any ideas on how to do this in a more elegant way?

Thanks!

<img align=right src="http://pics.10026.com/?src=somepage.aspx">

This will wrap text around it, aligning it on the right and let you use "somepage.aspx" to generate the ad

Straight ASP problem

Hi there.
I am having a weird problem. Currently I have a straight ASP page that
queries an Access database and returns the large recordset on a page that
loops through the recordset and writes the appropriate <td> tags in order to
put the data into a table. Now when I run it in my test environment it runs
no problem, however when I upload to my ISP I get a iis 500 error. But no
error on test server.
A few things: I have noticed that if I decrease the the number of
Response.Write and rstSearch.Fields("FIeldName") code lines that it works
ok on the ISP server.
Any ideas?
JoePart of the web configuration in IIS is the time allowed for a page to run.
If it goes beyond say 900 seconds IIS thinks it's hit an error and declares
a problem.
Another part of the configuration tells IIS what to do with errors; either
give an unhelpful 'an error occurred...' message or give full details to
help the developer figure out what went wrong. In a production environment
IIS is usually set to give no help to potential hackers.
It may simply be that having so many response.write lines in your page takes
too long to process. That would explain why removing some of them fixes the
problem.
Suggestions:
Increase the time-out period by alering the config on your IIS server.
Decrease the size of the recordset. Maybe use paging?
Brian Lowe
--@.
"Joe Coppola" <jocojr@.hotmail.com> wrote in message
news:OyBzKycUEHA.3420@.TK2MSFTNGP12.phx.gbl...
> Hi there.
> I am having a weird problem. Currently I have a straight ASP page that
> queries an Access database and returns the large recordset on a page that
> loops through the recordset and writes the appropriate <td> tags in order
to
> put the data into a table. Now when I run it in my test environment it
runs
> no problem, however when I upload to my ISP I get a iis 500 error. But no
> error on test server.
> A few things: I have noticed that if I decrease the the number of
> Response.Write and rstSearch.Fields("FIeldName") code lines that it works
> ok on the ISP server.
> Any ideas?
> Joe
>
Brian,
Thanks for the reply. I too thought about the timeout setting, but
interestingly I changed the timeout setting on my test server to be like 1
second and I dont get the error, the page just doesnt finish loading
completely. Note I also set the timeout or ASP pages as well.
Is there a way to get a more complete error message?
You are correct the # of response lines is sort of the cause, and I have
thought of paging the results, however, I need the users to be able to
export the whole results to another program... any ideas of this?
Well thanks for the help.
Joe
"Brian Lowe" <no@.reply.address> wrote in message
news:%23ZJsgHeUEHA.2580@.TK2MSFTNGP12.phx.gbl...
> Part of the web configuration in IIS is the time allowed for a page to
run.
> If it goes beyond say 900 seconds IIS thinks it's hit an error and
declares
> a problem.
> Another part of the configuration tells IIS what to do with errors; either
> give an unhelpful 'an error occurred...' message or give full details to
> help the developer figure out what went wrong. In a production environment
> IIS is usually set to give no help to potential hackers.
> It may simply be that having so many response.write lines in your page
takes
> too long to process. That would explain why removing some of them fixes
the
> problem.
> Suggestions:
> Increase the time-out period by alering the config on your IIS server.
> Decrease the size of the recordset. Maybe use paging?
> Brian Lowe
> --@.
> "Joe Coppola" <jocojr@.hotmail.com> wrote in message
> news:OyBzKycUEHA.3420@.TK2MSFTNGP12.phx.gbl...
that
order
> to
> runs
no
works
>

Straight ASP in VS.NET Question

All,
I have to set up a web server to handle
the following call:
<server URL>/Submit.asp?parm1={1}&parm2={2}&parm3={3}
I'm pretty lightweight in ASP.NET and a pure noob
in straight ASP. What's the easiest way to set
up a simple server page to grab these three parms
and invoke a method in my managed assembly?
Thank you,
~swoozin the page_load just add some Request.QueryString() calls, maybe a simple
switch() statement.
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"swoozie" <swooziep@.yahoo.com> wrote in message
news:1111071784.152396.227780@.o13g2000cwo.googlegroups.com...
> All,
> I have to set up a web server to handle
> the following call:
> <server URL>/Submit.asp?parm1={1}&parm2={2}&parm3={3}
> I'm pretty lightweight in ASP.NET and a pure noob
> in straight ASP. What's the easiest way to set
> up a simple server page to grab these three parms
> and invoke a method in my managed assembly?
> Thank you,
> ~swooz
>
Curt_C [MVP] wrote:
> in the page_load just add some Request.QueryString() calls, maybe a
simple
> switch() statement.
> --
> Curt Christianson
> Site & Scripts: http://www.Darkfalz.com
> Blog: http://blog.Darkfalz.com
>
Curt, thanks for the reply. I am still unsure
how to handle the "Submit.asp" in the URL. Do
I need to create a straight ASP page to handle
this? And there's the issue with ending up
in managed code with the parm values.
Thanks a lot!
~swooz
It's all yours now, Curt. -)
Kevin Spencer
Microsoft MVP
.Net Developer
What You S Is What You Get.
"swoozie" <swooziep@.yahoo.com> wrote in message
news:1111076028.221406.316920@.f14g2000cwb.googlegroups.com...
> Curt_C [MVP] wrote:
> simple
> Curt, thanks for the reply. I am still unsure
> how to handle the "Submit.asp" in the URL. Do
> I need to create a straight ASP page to handle
> this? And there's the issue with ending up
> in managed code with the parm values.
> Thanks a lot!
> ~swooz
>
huh? that makes little sense to me.....
Is this .ASP or .ASPX where you are trying to read the querystring values?
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"swoozie" <swooziep@.yahoo.com> wrote in message
news:1111076028.221406.316920@.f14g2000cwb.googlegroups.com...
> Curt_C [MVP] wrote:
> simple
> Curt, thanks for the reply. I am still unsure
> how to handle the "Submit.asp" in the URL. Do
> I need to create a straight ASP page to handle
> this? And there's the issue with ending up
> in managed code with the parm values.
> Thanks a lot!
> ~swooz
>
I got the feeling I missed something, but thanks for the warning :}
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> wrote in message
news:eKvNk0wKFHA.2648@.TK2MSFTNGP14.phx.gbl...
> It's all yours now, Curt. -)
> --
> Kevin Spencer
> Microsoft MVP
> .Net Developer
> What You S Is What You Get.
> "swoozie" <swooziep@.yahoo.com> wrote in message
> news:1111076028.221406.316920@.f14g2000cwb.googlegroups.com...
>
I'm sorry if I wasn't clear. The HTTP GET is from a 3rd-party
client, so I have to handle the URL with ".asp" in it (see above).
If I can handle that with ASP.NET, great! Can I set up a redirect
to an ASPX? Either way, I need to end up with the parms
in a managed assembly, be it web tier or middle. I'm fairly new
to this, so apologies in advance. And thanks so much for the help.
~swooz
One more post to further clarify! ;-)
I am assuming since they're throwing ".asp" at me
that I need to have a classic ASP page on the web
server.
you mean that THEY are pointing to YOUR site like this:
http://www.yoursite.com/submit.asp?parm1={1}&parm2={2}&parm3={3}
If so, few things...
1) wrong group, this is a .NET group.
2) you will need a page on your server called "submit.asp"
3) in that page you will need:
- myValue1 = Request.QueryString("param1")
- myValue2 = Request.QueryString("param2")
- myValue3 = Request.QueryString("param3")
that clarify it for ya?
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"swoozie" <swooziep@.yahoo.com> wrote in message
news:1111079290.380858.246130@.f14g2000cwb.googlegroups.com...
> One more post to further clarify! ;-)
> I am assuming since they're throwing ".asp" at me
> that I need to have a classic ASP page on the web
> server.
>
Yes, it does clarify, thanks. I did the .NET
newsgroup b/c [so far] I've written a pure .NET
app, but it appears I'm gonna have to have
an unmanaged piece in there.
ty

Straight ASP in VS.NET Question

All,

I have to set up a web server to handle
the following call:

<server URL>/Submit.asp?parm1={1}&parm2={2}&parm3={3}

I'm pretty lightweight in ASP.NET and a pure noob
in straight ASP. What's the easiest way to set
up a simple server page to grab these three parms
and invoke a method in my managed assembly?

Thank you,
~swoozin the page_load just add some Request.QueryString() calls, maybe a simple
switch() statement.

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com

"swoozie" <swooziep@.yahoo.com> wrote in message
news:1111071784.152396.227780@.o13g2000cwo.googlegr oups.com...
> All,
> I have to set up a web server to handle
> the following call:
> <server URL>/Submit.asp?parm1={1}&parm2={2}&parm3={3}
> I'm pretty lightweight in ASP.NET and a pure noob
> in straight ASP. What's the easiest way to set
> up a simple server page to grab these three parms
> and invoke a method in my managed assembly?
> Thank you,
> ~swooz
Curt_C [MVP] wrote:
> in the page_load just add some Request.QueryString() calls, maybe a
simple
> switch() statement.
> --
> Curt Christianson
> Site & Scripts: http://www.Darkfalz.com
> Blog: http://blog.Darkfalz.com

Curt, thanks for the reply. I am still unsure
how to handle the "Submit.asp" in the URL. Do
I need to create a straight ASP page to handle
this? And there's the issue with ending up
in managed code with the parm values.

Thanks a lot!
~swooz
It's all yours now, Curt. -)

--

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"swoozie" <swooziep@.yahoo.com> wrote in message
news:1111076028.221406.316920@.f14g2000cwb.googlegr oups.com...
> Curt_C [MVP] wrote:
>> in the page_load just add some Request.QueryString() calls, maybe a
> simple
>> switch() statement.
>>
>> --
>> Curt Christianson
>> Site & Scripts: http://www.Darkfalz.com
>> Blog: http://blog.Darkfalz.com
>>
>>
> Curt, thanks for the reply. I am still unsure
> how to handle the "Submit.asp" in the URL. Do
> I need to create a straight ASP page to handle
> this? And there's the issue with ending up
> in managed code with the parm values.
> Thanks a lot!
> ~swooz
huh? that makes little sense to me.....
Is this .ASP or .ASPX where you are trying to read the querystring values?

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com

"swoozie" <swooziep@.yahoo.com> wrote in message
news:1111076028.221406.316920@.f14g2000cwb.googlegr oups.com...
> Curt_C [MVP] wrote:
>> in the page_load just add some Request.QueryString() calls, maybe a
> simple
>> switch() statement.
>>
>> --
>> Curt Christianson
>> Site & Scripts: http://www.Darkfalz.com
>> Blog: http://blog.Darkfalz.com
>>
>>
> Curt, thanks for the reply. I am still unsure
> how to handle the "Submit.asp" in the URL. Do
> I need to create a straight ASP page to handle
> this? And there's the issue with ending up
> in managed code with the parm values.
> Thanks a lot!
> ~swooz
I got the feeling I missed something, but thanks for the warning :}

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com

"Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> wrote in message
news:eKvNk0wKFHA.2648@.TK2MSFTNGP14.phx.gbl...
> It's all yours now, Curt. -)
> --
> Kevin Spencer
> Microsoft MVP
> .Net Developer
> What You Seek Is What You Get.
> "swoozie" <swooziep@.yahoo.com> wrote in message
> news:1111076028.221406.316920@.f14g2000cwb.googlegr oups.com...
>>
>> Curt_C [MVP] wrote:
>>> in the page_load just add some Request.QueryString() calls, maybe a
>> simple
>>> switch() statement.
>>>
>>> --
>>> Curt Christianson
>>> Site & Scripts: http://www.Darkfalz.com
>>> Blog: http://blog.Darkfalz.com
>>>
>>>
>>
>> Curt, thanks for the reply. I am still unsure
>> how to handle the "Submit.asp" in the URL. Do
>> I need to create a straight ASP page to handle
>> this? And there's the issue with ending up
>> in managed code with the parm values.
>>
>> Thanks a lot!
>> ~swooz
>>
I'm sorry if I wasn't clear. The HTTP GET is from a 3rd-party
client, so I have to handle the URL with ".asp" in it (see above).
If I can handle that with ASP.NET, great! Can I set up a redirect
to an ASPX? Either way, I need to end up with the parms
in a managed assembly, be it web tier or middle. I'm fairly new
to this, so apologies in advance. And thanks so much for the help.

~swooz
One more post to further clarify! ;-)
I am assuming since they're throwing ".asp" at me
that I need to have a classic ASP page on the web
server.
you mean that THEY are pointing to YOUR site like this:

http://www.yoursite.com/submit.asp?parm1={1}&parm2={2}&parm3={3}

If so, few things...
1) wrong group, this is a .NET group.
2) you will need a page on your server called "submit.asp"
3) in that page you will need:
- myValue1 = Request.QueryString("param1")
- myValue2 = Request.QueryString("param2")
- myValue3 = Request.QueryString("param3")

that clarify it for ya?

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com

"swoozie" <swooziep@.yahoo.com> wrote in message
news:1111079290.380858.246130@.f14g2000cwb.googlegr oups.com...
> One more post to further clarify! ;-)
> I am assuming since they're throwing ".asp" at me
> that I need to have a classic ASP page on the web
> server.
Yes, it does clarify, thanks. I did the .NET
newsgroup b/c [so far] I've written a pure .NET
app, but it appears I'm gonna have to have
an unmanaged piece in there.

ty
or get them to point to a .aspx page instead

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com

"swoozie" <swooziep@.yahoo.com> wrote in message
news:1111080239.282185.68350@.l41g2000cwc.googlegro ups.com...
> Yes, it does clarify, thanks. I did the .NET
> newsgroup b/c [so far] I've written a pure .NET
> app, but it appears I'm gonna have to have
> an unmanaged piece in there.
> ty

Straight ASP problem

Hi there.

I am having a weird problem. Currently I have a straight ASP page that
queries an Access database and returns the large recordset on a page that
loops through the recordset and writes the appropriate <td> tags in order to
put the data into a table. Now when I run it in my test environment it runs
no problem, however when I upload to my ISP I get a iis 500 error. But no
error on test server.

A few things: I have noticed that if I decrease the the number of
Response.Write and rstSearch.Fields("FIeldName") code lines that it works
ok on the ISP server.

Any ideas?

JoePart of the web configuration in IIS is the time allowed for a page to run.
If it goes beyond say 900 seconds IIS thinks it's hit an error and declares
a problem.

Another part of the configuration tells IIS what to do with errors; either
give an unhelpful 'an error occurred...' message or give full details to
help the developer figure out what went wrong. In a production environment
IIS is usually set to give no help to potential hackers.

It may simply be that having so many response.write lines in your page takes
too long to process. That would explain why removing some of them fixes the
problem.

Suggestions:

Increase the time-out period by alering the config on your IIS server.

Decrease the size of the recordset. Maybe use paging?

Brian Lowe
---@.

"Joe Coppola" <jocojr@.hotmail.com> wrote in message
news:OyBzKycUEHA.3420@.TK2MSFTNGP12.phx.gbl...
> Hi there.
> I am having a weird problem. Currently I have a straight ASP page that
> queries an Access database and returns the large recordset on a page that
> loops through the recordset and writes the appropriate <td> tags in order
to
> put the data into a table. Now when I run it in my test environment it
runs
> no problem, however when I upload to my ISP I get a iis 500 error. But no
> error on test server.
> A few things: I have noticed that if I decrease the the number of
> Response.Write and rstSearch.Fields("FIeldName") code lines that it works
> ok on the ISP server.
> Any ideas?
> Joe
Brian,

Thanks for the reply. I too thought about the timeout setting, but
interestingly I changed the timeout setting on my test server to be like 1
second and I dont get the error, the page just doesnt finish loading
completely. Note I also set the timeout or ASP pages as well.

Is there a way to get a more complete error message?

You are correct the # of response lines is sort of the cause, and I have
thought of paging the results, however, I need the users to be able to
export the whole results to another program... any ideas of this?

Well thanks for the help.

Joe

"Brian Lowe" <no@.reply.address> wrote in message
news:%23ZJsgHeUEHA.2580@.TK2MSFTNGP12.phx.gbl...
> Part of the web configuration in IIS is the time allowed for a page to
run.
> If it goes beyond say 900 seconds IIS thinks it's hit an error and
declares
> a problem.
> Another part of the configuration tells IIS what to do with errors; either
> give an unhelpful 'an error occurred...' message or give full details to
> help the developer figure out what went wrong. In a production environment
> IIS is usually set to give no help to potential hackers.
> It may simply be that having so many response.write lines in your page
takes
> too long to process. That would explain why removing some of them fixes
the
> problem.
> Suggestions:
> Increase the time-out period by alering the config on your IIS server.
> Decrease the size of the recordset. Maybe use paging?
> Brian Lowe
> ---@.
> "Joe Coppola" <jocojr@.hotmail.com> wrote in message
> news:OyBzKycUEHA.3420@.TK2MSFTNGP12.phx.gbl...
> > Hi there.
> > I am having a weird problem. Currently I have a straight ASP page that
> > queries an Access database and returns the large recordset on a page
that
> > loops through the recordset and writes the appropriate <td> tags in
order
> to
> > put the data into a table. Now when I run it in my test environment it
> runs
> > no problem, however when I upload to my ISP I get a iis 500 error. But
no
> > error on test server.
> > A few things: I have noticed that if I decrease the the number of
> > Response.Write and rstSearch.Fields("FIeldName") code lines that it
works
> > ok on the ISP server.
> > Any ideas?
> > Joe

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.

straightforward way to programmatically retrieve string from db?

Hello -- I'm using asp.net 2 in visual web developer and I'm drawing a blank finding documentation on on this fairly simple task. Since this is the novice's thread, I felt bold enough to ask.

I'd like to programmatically retrieve a string from the aspnet_usermembership database -- the select statement would be something like the below. Can anyone point me at example code to do this programmatically -- so I end up with the LoweredEmail string from the DB? I guess I could either read it directly from the DB, or from a gridview control on the page -- but I'm new to SQL data manipulation and althoug I've seen examples nothing seems to work in this environment and it's probably simpler than I think to those who know what they;re doing..

Thanks for pointers.

"SELECT LoweredEmail FROM aspnet_Membership WHERE username=@dotnet.itags.org.Username"

Hey, just an idea. You can use SqlCommand.ExecuteScalar() to return a single value from database, assuming that your select SQL statment returns a scalar value. The method returns an object type so you need to comvert, in your case, a string type, like something below

...

dim LoweredEmail as String

dim SqlCmd as New SqlCommand("sql stmt", SqlConnObt)

LoweredEmail = CType(SqlCmd.ExecuteScalar(), String)

...


Thanks Bernie I'll give that a shot -- looks to be exactly what I needed.

Richard.


Worked fine -- just needed to do this in a two-stage process to get the GUID for the user from the username, which teyn gets teh email address. So added

Dim SqlEmailCmdAsNew SqlCommand("SELECT LoweredEmail FROM aspnet_Membership WHERE userid=@.Guid", myMembershipConnection)

SqlEmailCmd.Parameters.AddWithValue("@.Guid", userid)

Strange "ambiguous in namespace" complier error disappears with rebuild

Hi all.
I am using VS 2005 and VB.NET.
Lately as my Web Application is getting larger, I have been getting strange
compiler messages like the following:
--
Compiler Error Message: BC30560: 'controls_user_createquicksearchbar_ascx
'
is ambiguous in the namespace 'ASP'.
Source Error:
Line 9:
Line 10: <asp:Content ID="Content1" ContentPlaceHolderID="Content1"
Runat="Server">
Line 11: <uc1:CreateQuickSearchBar ID="CreateQuickSearchBar1"
runat="server" />
Line 12:
Line 13: <uc2:PCSavedSearches ID="PCSavedSearches1" runat="server" />
--
This typically occurs after I have made a change that is in a code-behind
page in which the offending User Control is placed and I do a complete
rebuild and then test.
After the error occurs without making any other changes to the code, I
simply do another full rebuild from within VS and the error goes away and
does not re-occur.
Has anyone experienced this? Is there a fix for it? It is becoming both
annoying and time-consuming.
TIA"John Kotuby" <JohnKotuby@.discussions.microsoft.com> wrote in message
news:%23ahALGOPIHA.5160@.TK2MSFTNGP05.phx.gbl...
> Hi all.
> I am using VS 2005 and VB.NET.
> Lately as my Web Application is getting larger, I have been getting
> strange compiler messages like the following:
> --
> Compiler Error Message: BC30560: 'controls_user_createquicksearchbar_ascx
'
> is ambiguous in the namespace 'ASP'.
> Source Error:
> Line 9:
> Line 10: <asp:Content ID="Content1" ContentPlaceHolderID="Content1"
> Runat="Server">
> Line 11: <uc1:CreateQuickSearchBar ID="CreateQuickSearchBar1"
> runat="server" />
> Line 12:
> Line 13: <uc2:PCSavedSearches ID="PCSavedSearches1" runat="server" />
> --
> This typically occurs after I have made a change that is in a code-behind
> page in which the offending User Control is placed and I do a complete
> rebuild and then test.
> After the error occurs without making any other changes to the code, I
> simply do another full rebuild from within VS and the error goes away and
> does not re-occur.
> Has anyone experienced this? Is there a fix for it? It is becoming both
> annoying and time-consuming.
> TIA
>
I have exactly the same problem. I have googled, asked here but no answers
/ solutions. Get out of the car and get back in. The only thing I can
think of is that depending on where my right hand is (on mouse or keyboard)
I will use F5 or click start debugging toolbar button. I always thought
that was the same but it seems that if I use only one of those combinations
I don't get the problem.
LS

Strang behaviour of multiselection Listbox

Hello,

i´d like to get access to the selected items of my listbox...

I did this in a loop, but I get only acces to the first selected item of the Listbox.

Has anyone solved the same problem? I really need help. Thx in advance.

Code (VB.net):

dim el as listitemfor each el in mylistbox.Items if el.selected then 'do something end ifnext

Give this a try...

 iCnt = 0 Dim li As ListItem For Each li In myListBox.Items If li.Selected Then iCnt += 1 Next If iCnt <> 0 Then Dim i As Integer iCnt = myListBox.Items.Count For i = 0 To iCnt - 1 If myListBox.Items(i).Selected Then 'Do Something End If Next
 End If
 Zath

Still the same problemSad
I´m sad...

But thank you for the try...

That shouldn't be.

Do you have this line in there?

If myListBox.Items(i).Selected Then

Zath


Yes...

No matter what I do, the first selected item returns true for .selected

the next ones return false...


ListBoxes (and CheckBoxLists) expose a new property called "GetSelectedIndices()"

So you can say

Dim LI As ListItem
For Each idx As Int32 in mylistbox.GetSelectedIndices()
LI = mylistbox.Items(idx)
'Do what you need to do with this selected list item
Next

*If* that doesn't work for you, and there is absolutely no reason why this code or the code you posted shouldn't... then you have other issues, like for instance, re-binding the list on every page load (which would "reset" the listboxbefore your event handler got a hold of the control)


I´m working on 1.1 so that the above function is not available for me...


But I will check the second issue. Thanks for the hint...


That did the trick... Sorry for the wasting of your time...

Did a wrong binding on PostBacks so I killed all of the selections except of one in the listbox...

*smashing head against the next wall*


i can't speak for the others replying on this topic... but you didn't/aren't wasting my time... glad to help out...

the whole binding cylce is a huge "gotcha" in .NET, we've all had our battles with it


(this is where you tell them "but it sure is great thatEasyListBox doesn't have that problem" Big Smile )

Strange "expected ;" error

I am getting an error and I can't seem to figure out why. The error is on line 32.

Compiler Error Message: CS1002: ; expected

Line 30: strScriptName=Request.ServerVariables("SCRIPT_NAME");
Line 31: strFolder="/buildlauncher/";
Line 32: If (strScriptName.IndexOf(strFolder)=-1)
Line 33: {
Line 34: strbuildlauncher="class='selected'";

The language I am using is C# and I don't seem to understand what a ; would be doing in an if statement. What I am trying to do is determine if the folder specified in the strFolder variable is in the server variable SCRIPT_NAME.There are some syntax problems here:

If (strScriptName.IndexOf(strFolder)=-1)

should probably be

if(strScriptName.IndexOf(strFolder) == -1)

Note the case sensitivity and the equality operator.

Strange "ambiguous in namespace" complier error disappears with rebuild

Hi all.

I am using VS 2005 and VB.NET.
Lately as my Web Application is getting larger, I have been getting strange
compiler messages like the following:
--------
Compiler Error Message: BC30560: 'controls_user_createquicksearchbar_ascx'
is ambiguous in the namespace 'ASP'.

Source Error:

Line 9:
Line 10: <asp:Content ID="Content1" ContentPlaceHolderID="Content1"
Runat="Server">
Line 11: <uc1:CreateQuickSearchBar ID="CreateQuickSearchBar1"
runat="server" />
Line 12:
Line 13: <uc2:PCSavedSearches ID="PCSavedSearches1" runat="server" />
--------

This typically occurs after I have made a change that is in a code-behind
page in which the offending User Control is placed and I do a complete
rebuild and then test.

After the error occurs without making any other changes to the code, I
simply do another full rebuild from within VS and the error goes away and
does not re-occur.

Has anyone experienced this? Is there a fix for it? It is becoming both
annoying and time-consuming.

TIA"John Kotuby" <JohnKotuby@.discussions.microsoft.comwrote in message
news:%23ahALGOPIHA.5160@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

Hi all.
>
I am using VS 2005 and VB.NET.
Lately as my Web Application is getting larger, I have been getting
strange compiler messages like the following:
--------
Compiler Error Message: BC30560: 'controls_user_createquicksearchbar_ascx'
is ambiguous in the namespace 'ASP'.
>
Source Error:
>
Line 9:
Line 10: <asp:Content ID="Content1" ContentPlaceHolderID="Content1"
Runat="Server">
Line 11: <uc1:CreateQuickSearchBar ID="CreateQuickSearchBar1"
runat="server" />
Line 12:
Line 13: <uc2:PCSavedSearches ID="PCSavedSearches1" runat="server" />
--------
>
This typically occurs after I have made a change that is in a code-behind
page in which the offending User Control is placed and I do a complete
rebuild and then test.
>
After the error occurs without making any other changes to the code, I
simply do another full rebuild from within VS and the error goes away and
does not re-occur.
>
Has anyone experienced this? Is there a fix for it? It is becoming both
annoying and time-consuming.
>
TIA
>


I have exactly the same problem. I have googled, asked here but no answers
/ solutions. Get out of the car and get back in. The only thing I can
think of is that depending on where my right hand is (on mouse or keyboard)
I will use F5 or click start debugging toolbar button. I always thought
that was the same but it seems that if I use only one of those combinations
I don't get the problem.

LS

strange & weird problem in ASP.NET application

I am having a strange problem in my ASP.NET application. When
multiple users access the web site, the changes done by a user gets
reflected in another users session.

I have some global variables declared in a module which I use
throughout the application. Is it problem because of this? If I cant
declare a global variable in a module where else can I declare it
where it cannot be changed when multiple users are accessing the same
variable?

Please somebody help me.

-Shalinthat would be the difference betueen session variables and application
variables
you would need session variables
have a look at the pass variables value between diferent pages thread

hope it helps

eric

"shalin" <shalin@.imagine.co.in> wrote in message
news:2acc1eb4.0402260345.4dd44352@.posting.google.c om...
> I am having a strange problem in my ASP.NET application. When
> multiple users access the web site, the changes done by a user gets
> reflected in another users session.
> I have some global variables declared in a module which I use
> throughout the application. Is it problem because of this? If I cant
> declare a global variable in a module where else can I declare it
> where it cannot be changed when multiple users are accessing the same
> variable?
> Please somebody help me.
> -Shalin

Strange "Object reference not set to an instance of an object" error in webform

I suddenly received an unexpected error in my project. I have been working
on this project for some time without this issue. Nothing has changed in the
form that caused the exception. A little experimentation shows that I cannot
run ANY .NET web project without getting this error:

-----------------------
--

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 1: <%@dotnet.itags.org. Page Language="vb" AutoEventWireup="false"
Codebehind="Login.aspx.vb" Inherits="DataBayWeb.Login" %>
Line 2: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
Line 3: <HTML
Source File: c:\inetpub\wwwroot\DataBayWeb\login.aspx Line: 1

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an
object.]
System.Web.UI.Control.get_Controls()
System.Web.UI.Control.AddParsedSubObject(Object obj)

System.Web.UI.Control.System.Web.UI.IParserAccesso r.AddParsedSubObject(Objec
t obj)
ASP.Login_aspx.__BuildControlTree(Control __ctrl) in
c:\inetpub\wwwroot\DataBayWeb\login.aspx:1
ASP.Login_aspx.FrameworkInitialize()
System.Web.UI.Page.ProcessRequest()
System.Web.UI.Page.ProcessRequest(HttpContext context)

System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication+IExecutionSte
p.Execute()
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously)

Other developers on my team can run the latest version of the project
without an issue. What has happened?

ChrisVery strange indeed. It might sound obscure, but try removing the
space in <%@. Page...

Otherwise, I would be tempted to do the inevitable and reinstall the
framework.

Simon.

Strange "Object reference not set to an instance of an object" error in web

I suddenly received an unexpected error in my project. I have been working
on this project for some time without this issue. Nothing has changed in the
form that caused the exception. A little experimentation shows that I cannot
run ANY .NET web project without getting this error:
----
--
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 1: <%@dotnet.itags.org. Page Language="vb" AutoEventWireup="false"
Codebehind="Login.aspx.vb" Inherits="DataBayWeb.Login" %>
Line 2: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
Line 3: <HTML>
Source File: c:\inetpub\wwwroot\DataBayWeb\login.aspx Line: 1
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an
object.]
System.Web.UI.Control.get_Controls()
System.Web.UI.Control.AddParsedSubObject(Object obj)
System.Web.UI.Control.System.Web.UI.IParserAccessor.AddParsedSubObject(Objec
t obj)
ASP.Login_aspx.__BuildControlTree(Control __ctrl) in
c:\inetpub\wwwroot\DataBayWeb\login.aspx:1
ASP.Login_aspx.FrameworkInitialize()
System.Web.UI.Page.ProcessRequest()
System.Web.UI.Page.ProcessRequest(HttpContext context)
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionSte
p.Execute()
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously)
Other developers on my team can run the latest version of the project
without an issue. What has happened?
ChrisVery strange indeed. It might sound obscure, but try removing the
space in <%@. Page...
Otherwise, I would be tempted to do the inevitable and reinstall the
framework.
Simon.

strange 404 in ASP.NET IIS5

I have been receiving this very strange 404 lately and was wondering
if anyone else out there has had a similar problem. For some reason
when users receive this error and they hit refresh the error goes
away. Seems like a IE or ASP.NET cache problem, but can not find any
articles on it.

404 not found C:\inetpub\mySite\mySite_com_files\pictures.aspx

StackTrace
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)

-MikeOh yeah, sometimes instead of mySite_com_files it will be a username_com_files or username_files. _files is on all these 404's no matter what was before it.

-Mike

-- Mike wrote: --

I have been receiving this very strange 404 lately and was wondering
if anyone else out there has had a similar problem. For some reason
when users receive this error and they hit refresh the error goes
away. Seems like a IE or ASP.NET cache problem, but can not find any
articles on it.

404 not found C:\inetpub\mySite\mySite_com_files\pictures.aspx

StackTrace
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)

-Mike

strange 404 error

I'm wondering if anyone has encountered something similar to the error I've pasted below. We get similar errors when someone hits a bad link etc., but the part I can't figure out here is where the string "ExpenseWatch_files" come from. The page TEPrintFrame.aspx resides in the TE folder. There is no intermediate directory and the string "ExpenseWatch_files" does not exist anywhere in our code. Also, I'm pretty sure that the user never knows that an error occurred even though it is trapped and reported.

Thanks in advance,

Sean Nolan

----------------
Message:
C:\Inetpub\wwwroot\ExpenseWatchApp\TE\ExpenseWatch _files\TEPrintFrame.aspx

Source:
System.Web

Stack Trace:
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)Probably a hacker, probing for a specific vulnerability in some commercial
product called "ExpenseWatch".

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Sean Nolan" <snolan@.harriton.com> wrote in message
news:#bm2B0##DHA.2520@.TK2MSFTNGP11.phx.gbl...
I'm wondering if anyone has encountered something similar to the error I've
pasted below. We get similar errors when someone hits a bad link etc., but
the part I can't figure out here is where the string "ExpenseWatch_files"
come from. The page TEPrintFrame.aspx resides in the TE folder. There is no
intermediate directory and the string "ExpenseWatch_files" does not exist
anywhere in our code. Also, I'm pretty sure that the user never knows that
an error occurred even though it is trapped and reported.

Thanks in advance,

Sean Nolan

----------------
Message:
C:\Inetpub\wwwroot\ExpenseWatchApp\TE\ExpenseWatch _files\TEPrintFrame.aspx

Source:
System.Web

Stack Trace:
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)

Strange 100% CPU issue with asp_wp

Hello,
We are having some issues with our .NET web applications. Every so
often a computer will peg its CPU at 100% for some period of time. I am
told anywhere between 30mins and 2 hours. I have seen some kb articles
about asp_wp and 100% but I do not believe that is our issues. I am
fairly certain that the probelm is caused by one of the applications
running on the server. Ok so here are the questions.
Are there any perfmons that can be used to determine which asp.net app
is causing the cpu to spike up?
Is there any code that can be written to see what is happening?
What I am trying to accomplish is to determine the offending
application. What toold exist?
Thanks
RichHi Rich
As for the 100% cpu and troubleshooting on multi-web app server problem.
There are different options which depend on the server's OS version. Is
your webserver win2k server or win2003 server?
If you're using the Win2k server, since the processModel are the fixed
isolation mode. All the web application shared the same workerprocess.
There hasn't any buildin means or tools to determine which app caues the
problem. We have to test them one by one.
However , on win2k3 box, the IIS6 has provided a new workerprocess
isolation model( application pool model) which can let use isolate each web
application in a separate workproesss. You can have a look at the following
reference discussing on this:
#Chapter 20 C Hosting Multiple Web Applications
http://msdn.microsoft.com/library/d...-us/dnnetsec/ht
ml/thcmch20.asp
Thanks.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Thanks for the feedback. This is a W2K server hosting these
applications. So I am left with the testing of individual applications.
Would this testing be done in a traditional manner (ie click and watch)?
If so I was hoping for something a little more than that. Any other
ideas? Thanks
Rich
In article <9LvS$c4eEHA.1600@.cpmsftngxa06.phx.gbl>, you say...
> Hi Rich
> As for the 100% cpu and troubleshooting on multi-web app server problem.
> There are different options which depend on the server's OS version. Is
> your webserver win2k server or win2003 server?
> If you're using the Win2k server, since the processModel are the fixed
> isolation mode. All the web application shared the same workerprocess.
> There hasn't any buildin means or tools to determine which app caues the
> problem. We have to test them one by one.
> However , on win2k3 box, the IIS6 has provided a new workerprocess
> isolation model( application pool model) which can let use isolate each we
b
> application in a separate workproesss. You can have a look at the followin
g
> reference discussing on this:
> #Chapter 20 =3FC Hosting Multiple Web Applications
> http://msdn.microsoft.com/library/d...ft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
> Get Preview at ASP.NET whidbey
> http://msdn.microsoft.com/asp.net/whidbey/default.aspx
>
>
>
Hi Rich,
Thanks for your followup. As for such problem, if you have found the web
application which cause the problem, I think you'd better continue to
narrow down the problem to some certain web pages or component which may be
the root cause. Also, you can have a check directly in the code logic to
see whether there is any potential issues. Currnetly there're any
particular tools focus on such problem.
In addition, if you still feel on this issue, I recommend that you
request a regular case on it since intensive troubleshooting(such as Dump
analyse) would be done quickly and effectively with direct assistance from
a Microsoft Support Professional through Microsoft Product Support
Services.
Thanks.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Thanks Steven. I was afraid there would be no way of tracking this
down. If we can't find the app we will contact MPS. Rich
In article <Cvm$ywefEHA.3212@.cpmsftngxa06.phx.gbl>, v-
schang@.online.microsoft.com says...
> Hi Rich,
> Thanks for your followup. As for such problem, if you have found the web
> application which cause the problem, I think you'd better continue to
> narrow down the problem to some certain web pages or component which may b
e
> the root cause. Also, you can have a check directly in the code logic to
> see whether there is any potential issues. Currnetly there're any
> particular tools focus on such problem.
> In addition, if you still feel on this issue, I recommend that yo
u
> request a regular case on it since intensive troubleshooting(such as Dump
> analyse) would be done quickly and effectively with direct assistance from
> a Microsoft Support Professional through Microsoft Product Support
> Services.
> Thanks.
>
> Regards,
> Steven Cheng
> Microsoft Online Support
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
> Get Preview at ASP.NET whidbey
> http://msdn.microsoft.com/asp.net/whidbey/default.aspx
>

Strange 100% CPU issue with asp_wp

Hello,
We are having some issues with our .NET web applications. Every so
often a computer will peg its CPU at 100% for some period of time. I am
told anywhere between 30mins and 2 hours. I have seen some kb articles
about asp_wp and 100% but I do not believe that is our issues. I am
fairly certain that the probelm is caused by one of the applications
running on the server. Ok so here are the questions.

Are there any perfmons that can be used to determine which asp.net app
is causing the cpu to spike up?

Is there any code that can be written to see what is happening?

What I am trying to accomplish is to determine the offending
application. What toold exist?

Thanks

RichHi Rich

As for the 100% cpu and troubleshooting on multi-web app server problem.
There are different options which depend on the server's OS version. Is
your webserver win2k server or win2003 server?

If you're using the Win2k server, since the processModel are the fixed
isolation mode. All the web application shared the same workerprocess.
There hasn't any buildin means or tools to determine which app caues the
problem. We have to test them one by one.

However , on win2k3 box, the IIS6 has provided a new workerprocess
isolation model( application pool model) which can let use isolate each web
application in a separate workproesss. You can have a look at the following
reference discussing on this:

#Chapter 20 C Hosting Multiple Web Applications
http://msdn.microsoft.com/library/d...-us/dnnetsec/ht
ml/thcmch20.asp

Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Thanks for the feedback. This is a W2K server hosting these
applications. So I am left with the testing of individual applications.
Would this testing be done in a traditional manner (ie click and watch)?
If so I was hoping for something a little more than that. Any other
ideas? Thanks

Rich

In article <9LvS$c4eEHA.1600@.cpmsftngxa06.phx.gbl>, you say...
> Hi Rich
> As for the 100% cpu and troubleshooting on multi-web app server problem.
> There are different options which depend on the server's OS version. Is
> your webserver win2k server or win2003 server?
> If you're using the Win2k server, since the processModel are the fixed
> isolation mode. All the web application shared the same workerprocess.
> There hasn't any buildin means or tools to determine which app caues the
> problem. We have to test them one by one.
> However , on win2k3 box, the IIS6 has provided a new workerprocess
> isolation model( application pool model) which can let use isolate each web
> application in a separate workproesss. You can have a look at the following
> reference discussing on this:
> #Chapter 20 =3FC Hosting Multiple Web Applications
> http://msdn.microsoft.com/library/d...-us/dnnetsec/ht
> ml/thcmch20.asp
>
> Thanks.
> Regards,
> Steven Cheng
> Microsoft Online Support
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
> Get Preview at ASP.NET whidbey
> http://msdn.microsoft.com/asp.net/whidbey/default.aspx
>
>
Hi Rich,

Thanks for your followup. As for such problem, if you have found the web
application which cause the problem, I think you'd better continue to
narrow down the problem to some certain web pages or component which may be
the root cause. Also, you can have a check directly in the code logic to
see whether there is any potential issues. Currnetly there're any
particular tools focus on such problem.
In addition, if you still feel confused on this issue, I recommend that you
request a regular case on it since intensive troubleshooting(such as Dump
analyse) would be done quickly and effectively with direct assistance from
a Microsoft Support Professional through Microsoft Product Support
Services.

Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Thanks Steven. I was afraid there would be no way of tracking this
down. If we can't find the app we will contact MPS. Rich

In article <Cvm$ywefEHA.3212@.cpmsftngxa06.phx.gbl>, v-
schang@.online.microsoft.com says...
> Hi Rich,
> Thanks for your followup. As for such problem, if you have found the web
> application which cause the problem, I think you'd better continue to
> narrow down the problem to some certain web pages or component which may be
> the root cause. Also, you can have a check directly in the code logic to
> see whether there is any potential issues. Currnetly there're any
> particular tools focus on such problem.
> In addition, if you still feel confused on this issue, I recommend that you
> request a regular case on it since intensive troubleshooting(such as Dump
> analyse) would be done quickly and effectively with direct assistance from
> a Microsoft Support Professional through Microsoft Product Support
> Services.
> Thanks.
>
> Regards,
> Steven Cheng
> Microsoft Online Support
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
> Get Preview at ASP.NET whidbey
> http://msdn.microsoft.com/asp.net/whidbey/default.aspx
>

Strange and annoying problem

Even commenting a line in javascript still prompts for an error. If I remove the following line then no error, but again if i put it back, even commented error occurs.

//opener.document.getElementById('<%=TextBox1.ClientID%>').value='akberalikaka';

isn't it strange behavior

Yes it is strange. As far as i am aware of, there are three types of comment you can do in java:

1. Multiple-line :/* and*/

2.One-line comments of C++ style: Begins with // and continue up to the next line break:

3.One-line comments with theHTML comment-opening sequence (<!--). Note that the JavaScript interpreter ignores the closing characters of HTML comments (-->). Consider this example:
<!-- This is treated as a one-line JS comment<!-- It works just like a comment beginning with //<!-- --> This is also a one-line JS comment<!-- --> because JS ignores the closing characters<!-- --> of HTML-style comments

HTML-style comments are not usually found in the middle of JavaScript code. However, it is recommended to use HTML comments for hiding Javascript code from old browsers

Try using this mate


Hi,

//opener.document.getElementById('<%=TextBox1.ClientID%>').value='akberalikaka';

Your comment in javascript doesn't stop<%=TextBox1.ClientID%> since it is asp.net code. So to clear the error you have to remove this code.


You have to comment the aspnet code also

if you are using C#

//opener.document.getElementById('<%/*=TextBox1.ClientID*/%>').value='akberalikaka';

if you are using VB

//opener.document.getElementById('<%'=TextBox1.ClientID'%>').value='akberalikaka';

<%'=TextBox1.ClientID'%> is equivalent to <% Response.Write(TextBox1.ClientID) %>