Showing posts with label scenario. Show all posts
Showing posts with label scenario. Show all posts

Thursday, March 22, 2012

strange globalization error

Hi People...

heres hoping someone has run into this scenario before;

I am trying to write a calendar maintenance page, as part of a larger web based app,

The problem: An exception is being raised in a globalization module;

thats not too strange, however the error only fires when there is a post-back from a link button !?

The error details are below..if that helps at all

thanks in advance..

Charli0

<ERROR TRACE
Exception Details:

System.ArgumentOutOfRangeException: Offset and length must refer to a position in the string. Parameter name: string1

Stack Trace:

[ArgumentOutOfRangeException: Offset and length must refer to a position in the string.
Parameter name: string1]
System.Globalization.CompareInfo.CompareRegion(Void* pSortingTable, Int32 win32LCID, String string1, Int32 offset1, Int32 length1, String string2, Int32 offset2, Int32 length2, CompareOptions options) +0
System.Globalization.CompareInfo.Compare(String string1, Int32 offset1, Int32 length1, String string2, Int32 offset2, Int32 length2, CompareOptions options) +54
System.String.Compare(String strA, Int32 indexA, String strB, Int32 indexB, Int32 length, Boolean ignoreCase, CultureInfo culture) +130
System.Web.UI.WebControls.Calendar.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()

</ERROR TRACECould do with a code sample.

Is thething you're comparing loosing it's value on postback?

Strange Javascript Cookie Behaviour

Hi folks,

Been looking at this for the day so any ideas would be appreciated. Here's
the scenario, bear with me - it looks more complicated than it is :)

I have a page templating system that inherits from the page class and adds a
mixture of usercontrols and literals when requested.

One of the usercontrols is a menu that expands on being clicked using DHTML.
What I'm trying to do is to persist the expanded menu to other pages or
accross page refreshes so that if a user expands the menu for a menu item on
one page it will be rendered on the following page as expanded for that same
menu item.

As the id of the span needs to be stored when it's clicked I figured that
the easiest way to accomplish this would be to set and pass the id of the
expanded menu item (a <span> element) in a cookie using javascript and then
check for the existence of this cookie and use it's value to expand the menu
using the onLoad attribute of the body tag on the new page.

The cookie is not persisted accross sessions - i.e. no expiry date is set. I
have not set the path either.

At the start of a new session on entering the first page of the site the
function checks the cookie, see's that it doesn't exist yet (as a menu item
hasn't been clicked/expanded yet) and the page simply loads.

On the first page I have established using alert boxes that when I click the
menu item/span the correct id is being being returned to an alert box set to
catch the onclick event and then the cookie is successfully set to the value
of the span id as I use an alert box to return the value of the cookie after
it's set. This works for all menu items.

when I navigate to another page an alert box displaying the cookie value
indicates that the cookie has been successfully persisted and the correct
span is expanded.

However, if I then click on other spans in the menu, the alert box that
displays the id of the span I have clicked returns the correct value and the
span expands, the following line of javascript set's the cookie supposedly
using this span id but in the next line of code producing the second alert
box reading the cookie, the alert box shows that the cookie has been set to
the original span id and not the one I actually clicked. This is confirmed
when I navigate to another page as the original span id is in the cookie and
that span is expanded.

Anyone got any ideas what's going on here???

Looking forward to hearing your ideas,

Bewildered JoeOk, I am officially dumb - it was a path problem - this dumbass takes a bow
;)

"Joe" <info@.hyper-typer.com> wrote in message
news:OykZ3D5uDHA.2880@.tk2msftngp13.phx.gbl...
> Hi folks,
> Been looking at this for the day so any ideas would be appreciated. Here's
> the scenario, bear with me - it looks more complicated than it is :)
> I have a page templating system that inherits from the page class and adds
a
> mixture of usercontrols and literals when requested.
> One of the usercontrols is a menu that expands on being clicked using
DHTML.
> What I'm trying to do is to persist the expanded menu to other pages or
> accross page refreshes so that if a user expands the menu for a menu item
on
> one page it will be rendered on the following page as expanded for that
same
> menu item.
> As the id of the span needs to be stored when it's clicked I figured that
> the easiest way to accomplish this would be to set and pass the id of the
> expanded menu item (a <span> element) in a cookie using javascript and
then
> check for the existence of this cookie and use it's value to expand the
menu
> using the onLoad attribute of the body tag on the new page.
> The cookie is not persisted accross sessions - i.e. no expiry date is set.
I
> have not set the path either.
> At the start of a new session on entering the first page of the site the
> function checks the cookie, see's that it doesn't exist yet (as a menu
item
> hasn't been clicked/expanded yet) and the page simply loads.
> On the first page I have established using alert boxes that when I click
the
> menu item/span the correct id is being being returned to an alert box set
to
> catch the onclick event and then the cookie is successfully set to the
value
> of the span id as I use an alert box to return the value of the cookie
after
> it's set. This works for all menu items.
> when I navigate to another page an alert box displaying the cookie value
> indicates that the cookie has been successfully persisted and the correct
> span is expanded.
> However, if I then click on other spans in the menu, the alert box that
> displays the id of the span I have clicked returns the correct value and
the
> span expands, the following line of javascript set's the cookie supposedly
> using this span id but in the next line of code producing the second alert
> box reading the cookie, the alert box shows that the cookie has been set
to
> the original span id and not the one I actually clicked. This is
confirmed
> when I navigate to another page as the original span id is in the cookie
and
> that span is expanded.
> Anyone got any ideas what's going on here???
> Looking forward to hearing your ideas,
> Bewildered Joe