Showing posts with label location. Show all posts
Showing posts with label location. Show all posts

Saturday, March 31, 2012

Set breakpoint in <script> in aspx source

How might I set a breakpoint in <script> (JS) in aspx source? I have no trouble if it's an external JS, but VS2005 Std sez "not a valid location for a breakpoint" if I try to set one in a <script> that's imbedded in the aspx file.

It′s really easy my friend:

1. Set the breakpoint (while not debugging the aspnet code).

2. While running your web page try to connect to the IExplore.exe process from the Debug menu, and that′s all.

Hope this helps.


Thanks for the input. Hmm...

here's the line I'd like to break at:

<script>
ScrollSelectedIDIntoView()
</script>

it's sitting at the bottom of a content panel of a "child" page. The function "ScrollSelectedIDIntoView" is in a JS file that's loaded into the Master page. (I moved the JS out to solve the problem, but this should still work). The code works fine.

However, when I click in the left margin next to the ScrollSelectedIDIntoView() line, to set the breakpoint, with code in "not debugging" mode, I get the message "this is not a valid location for a breakpoint" in the bottom bar of VS2005.


You were right, I was using my VS 2003 and it worked in there, but it happens just the same as you described (not a valid location for a breakpoint), that′s because it changed a little inVS 2005 and here is how it works:

1. Make sure you have the Internet explorer script debugging option enabled.

2. Start your project in debug mode and go to the debug-> Windows-> Script Explorer and browse the running scripts from there.

More info on these 2 good articles:

http://geekswithblogs.net/lazydeveloper/archive/2006/07/10/84552.aspx

http://timstall.dotnetdevelopersjournal.com/debugging_javascript_in_visual_studio.htm

Hope this helps!


Nikhil'sWeb Development Helper is great tool in web development and debugging. It makes you debug your script on the fly and its integrated with your IE

Thanks


Whoa, looks like I haven't been back in a while. Thanks for the inputs!

Tuesday, March 13, 2012

Set page to focus some certain location after post back

Hi,
I have a web form, after post back to itself, I need to make web page
scroll to some certian location instead of top. We only care IE.
Anybody has some idea how to do it?
WWW: http://hardywang.1accesshost.com
ICQ: 3359839
yours HardyIf you want a purist MS position, look at Smart Navigation.
//C#
Page.SmartNavigation=true;
Another option:
http://aspnet.4guysfromrolla.com/ar...111704-1.2.aspx
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
***************************
Think Outside the Box!
***************************
"Hardy Wang" wrote:

> Hi,
> I have a web form, after post back to itself, I need to make web page
> scroll to some certian location instead of top. We only care IE.
> Anybody has some idea how to do it?
> --
> WWW: http://hardywang.1accesshost.com
> ICQ: 3359839
> yours Hardy
>
>
Not maintain post back position, but scroll to certain location.
WWW: http://hardywang.1accesshost.com
ICQ: 3359839
yours Hardy
"Cowboy (Gregory A. Beamer) - MVP" <NoSpamMgbworld@.comcast.netNoSpamM> wrote
in message news:0C35D26C-5F0F-4DDB-A56A-BFCD12B5CB51@.microsoft.com...
> If you want a purist MS position, look at Smart Navigation.
> //C#
> Page.SmartNavigation=true;
> Another option:
> http://aspnet.4guysfromrolla.com/ar...111704-1.2.aspx
>
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
> ***************************
> Think Outside the Box!
> ***************************
> "Hardy Wang" wrote:
>
You will probably need to do this by using Javascript and using anchor
tags.
Place name anchors throughout the page like:
<a name="top">Top</a>
<a name="middle">Middle</a>
<a name="bottom">Bottom</a>
Then you could push Javascript out from the code-behind something like:
<script>
window.navigate('#bottom');
</script>
The page would then scroll to the bottom. Just make sure your
javascript appears last in the page after all the sections of the page
have been named...
If you know the postition you want.
//client side script
function __dascwebLoadScrollPosition( top, left )
{
window.document.body.scrollLeft = top;
window.document.body.scrollTop = left;
}
You can set the scrollLeft and scrollTop of the body. If you don't know the
position, you can do aa7im suggested with anchor tags.
bill
"Hardy Wang" <hardywang@.hotmail.com> wrote in message
news:%23HRqRkV3EHA.208@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I have a web form, after post back to itself, I need to make web page
> scroll to some certian location instead of top. We only care IE.
> Anybody has some idea how to do it?
> --
> WWW: http://hardywang.1accesshost.com
> ICQ: 3359839
> yours Hardy
>

Set page to focus some certain location after post back

Hi,
I have a web form, after post back to itself, I need to make web page
scroll to some certian location instead of top. We only care IE.
Anybody has some idea how to do it?

--
WWW: http://hardywang.1accesshost.com
ICQ: 3359839
yours HardyIf you want a purist MS position, look at Smart Navigation.

//C#
Page.SmartNavigation=true;

Another option:
http://aspnet.4guysfromrolla.com/ar...111704-1.2.aspx

--

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

"Hardy Wang" wrote:

> Hi,
> I have a web form, after post back to itself, I need to make web page
> scroll to some certian location instead of top. We only care IE.
> Anybody has some idea how to do it?
> --
> WWW: http://hardywang.1accesshost.com
> ICQ: 3359839
> yours Hardy
>
Not maintain post back position, but scroll to certain location.

--
WWW: http://hardywang.1accesshost.com
ICQ: 3359839
yours Hardy
"Cowboy (Gregory A. Beamer) - MVP" <NoSpamMgbworld@.comcast.netNoSpamM> wrote
in message news:0C35D26C-5F0F-4DDB-A56A-BFCD12B5CB51@.microsoft.com...
> If you want a purist MS position, look at Smart Navigation.
> //C#
> Page.SmartNavigation=true;
> Another option:
> http://aspnet.4guysfromrolla.com/ar...111704-1.2.aspx
>
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
> ***************************
> Think Outside the Box!
> ***************************
> "Hardy Wang" wrote:
>> Hi,
>> I have a web form, after post back to itself, I need to make web page
>> scroll to some certian location instead of top. We only care IE.
>> Anybody has some idea how to do it?
>>
>> --
>> WWW: http://hardywang.1accesshost.com
>> ICQ: 3359839
>> yours Hardy
>>
>>
>
You will probably need to do this by using Javascript and using anchor
tags.

Place name anchors throughout the page like:

<a name="top">Top</a>
<a name="middle">Middle</a>
<a name="bottom">Bottom</a
Then you could push Javascript out from the code-behind something like:

<script>
window.navigate('#bottom');
</script
The page would then scroll to the bottom. Just make sure your
javascript appears last in the page after all the sections of the page
have been named...
If you know the postition you want.

//client side script
function __dascwebLoadScrollPosition( top, left )
{
window.document.body.scrollLeft = top;
window.document.body.scrollTop = left;
}

You can set the scrollLeft and scrollTop of the body. If you don't know the
position, you can do aa7im suggested with anchor tags.

bill

"Hardy Wang" <hardywang@.hotmail.com> wrote in message
news:%23HRqRkV3EHA.208@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I have a web form, after post back to itself, I need to make web page
> scroll to some certian location instead of top. We only care IE.
> Anybody has some idea how to do it?
> --
> WWW: http://hardywang.1accesshost.com
> ICQ: 3359839
> yours Hardy