Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

User control refresh by itself

Posted on 2004-11-04
8
Medium Priority
?
244 Views
Last Modified: 2008-01-09
Someone told me that is was possible to have a usercontrol refresh itself without the holding page being refreshed.

If this is true can someone please explain how!

Thanks
0
Comment
Question by:PapaSmurf
  • 3
  • 2
6 Comments
 
LVL 4

Expert Comment

by:Pstry
ID: 12491004

Only possible when you put the user control inside FRAME or IFRAME.
Also some ActiveX may do your job.
0
 

Author Comment

by:PapaSmurf
ID: 12491091
Thanks Pstry

I'm trying to fix a common problem. I want to display the details of a row in a datagrid cell, but without the page scrolling back to the top. I'll try out some iframes....
0
 
LVL 21

Accepted Solution

by:
surajguptha earned 200 total points
ID: 12491188
Using the javascript below you can set the focus to the datagrid cell and prevent it from scrolling back after post backs.


<script language=javascript>
function scrollToCoordinates() {
  window.scrollTo(#FORM.scrollx#, #FORM.scrolly#);
}

function saveScrollCoordinates() {
  document.Form1.scrollx.value = (document.all)?document.body.scrollLeft:window.pageXOffset;
  document.Form1.scrolly.value = (document.all)?document.body.scrollTop:window.pageYOffset;
}
</script>

<body onload="javascript:scrollToCoordinates()">


Hope this helps
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 21

Expert Comment

by:surajguptha
ID: 12491197
or you can try "document.all.datagridname.focus()"  on page load. So when the page loads the focus will come to the datagrid rather than the top
0
 

Author Comment

by:PapaSmurf
ID: 12496134
thanks surajguptha

I'm only just understanding your code suggestion, i guess i need to call saveScrollCoordinates from my code?

sorry bit new to this still :-)

0
 

Author Comment

by:PapaSmurf
ID: 12703500
fine
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question