473,382 Members | 1,615 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Problem with Autopostback

I have a relatively long page with a number of webcontrols with
"autopostback" set to true. The contents/items/datasources of the subsequent
webcontrols are dynamically populated depending on the selection of previous
webcontrols' selected item.

My question is : everytime the user selects an option from a webcontrol, due
to the autopostback being turned on, the page refreshes itself to populate
the subsequent controls. The problem I have is that when it refreshes, it
always ends up showing the top of my very long page.

Are there anyway i could somehow return to the location of the last selected
control that triggered that event or the next control after that? Anchors
does not work here, does it? If not, then how do i do it?

Please help!
Nov 17 '05 #1
4 3288
Hi,

Turn the smartnavigation on.

http://msdn.microsoft.com/library/de.../en-us/cpref/h
tml/frlrfsystemwebuipageclasssmartnavigationtopic.asp

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #2
Add the following to the page directives, it works for ie5 and above maybe
others
<%@Page ... SmartNavigation="true"%>

"Jesse" <je******@hotmail.com> wrote in message
news:eU**************@tk2msftngp13.phx.gbl...
I have a relatively long page with a number of webcontrols with
"autopostback" set to true. The contents/items/datasources of the subsequent webcontrols are dynamically populated depending on the selection of previous webcontrols' selected item.

My question is : everytime the user selects an option from a webcontrol, due to the autopostback being turned on, the page refreshes itself to populate
the subsequent controls. The problem I have is that when it refreshes, it
always ends up showing the top of my very long page.

Are there anyway i could somehow return to the location of the last selected control that triggered that event or the next control after that? Anchors
does not work here, does it? If not, then how do i do it?

Please help!

Nov 17 '05 #3
"Jesse" <je******@hotmail.com> wrote in message
news:eU**************@tk2msftngp13.phx.gbl...
I have a relatively long page with a number of webcontrols with
"autopostback" set to true. The contents/items/datasources of the subsequent webcontrols are dynamically populated depending on the selection of previous webcontrols' selected item.

My question is : everytime the user selects an option from a webcontrol, due to the autopostback being turned on, the page refreshes itself to populate
the subsequent controls. The problem I have is that when it refreshes, it
always ends up showing the top of my very long page.

Are there anyway i could somehow return to the location of the last selected control that triggered that event or the next control after that? Anchors
does not work here, does it? If not, then how do i do it?


To make a workaround in other browsers apart from IE5 and 6, you could
think of inserting a numbered bookmark with each control:
<a name="bookmark01">&nbsp</a>

Then, on postback, insert a script to go to the right bookmark:
Sub InsertScriptBlock()
Dim jScript As new System.Text.StringBuilder()
jScript.Append("<script language='JavaScript'>")
jScript.Append("location.href='#bookmark01';")
jScript.Append("</scr" & "ipt>")
Me.RegisterClientScriptBlock("Bookmark", jScript.ToString())
End Sub

--

Jos Branders
Nov 17 '05 #4
Thank you Natty Gur!
Thank you Jason Turim!
Thank you Jos Branders!

You guys just saved my life!!!

"Jesse" <je******@hotmail.com> wrote in message
news:eU**************@tk2msftngp13.phx.gbl...
I have a relatively long page with a number of webcontrols with
"autopostback" set to true. The contents/items/datasources of the subsequent webcontrols are dynamically populated depending on the selection of previous webcontrols' selected item.

My question is : everytime the user selects an option from a webcontrol, due to the autopostback being turned on, the page refreshes itself to populate
the subsequent controls. The problem I have is that when it refreshes, it
always ends up showing the top of my very long page.

Are there anyway i could somehow return to the location of the last selected control that triggered that event or the next control after that? Anchors
does not work here, does it? If not, then how do i do it?

Please help!

Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Steven | last post by:
I create the checkboxes dynamically on my webform (aspx). after I create them, when I check any of the checkboxes, nothing happens. Here is my code ... ArrayList LayerNameList1 = LayerNameList;...
3
by: Lloyd Sheen | last post by:
I have a page that works fine. I am trying to optimize the page by overriding some of the Information that is being saved in the hidden VIEWSTATE. If I make the properties of the dropdown False...
8
by: Matthew Louden | last post by:
why need to set autopostback property to be true?? I know autopostback event means to send the form to the server automatically. I tried checkbox, checkbox list, radio button, and radio button...
2
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
1
by: postings | last post by:
Hi I have problems with autopostback and the gridview control. Please continue reading. The code below turns a row red when a tickbox is ticked in edititemtemplate. Note autopostback on the...
2
by: rn5a | last post by:
Assume that a user control has a TextBox (Page1.ascx) <asp:TextBox ID="txtName" runat="server"/> I am encapsulating the above user control in a ASPX page named Page1.aspx i.e. the ASPX page...
0
by: andy | last post by:
Hi, I have a form uses several dropdownlists to narrow a set of criteria. ( This is in turn used to control what is shown on a gridview. ) With each, the user selects an entry and then the next...
6
by: Peter | last post by:
ASP.NET 2.0 Visual Studio 2008 I have the following code and when the textbox displays and I press Enter while in the text box I get AutoPostBack, how do I stop AutoPostBack? TextBox txt =...
15
by: Chris | last post by:
Hi, When choosing a value in the dropdownlist, i try to put that selectedvalue in the label, but i always get the first value 'a'. EnableViewState is by default set to true, so ... what's wrong...
6
by: shashi shekhar singh | last post by:
Respected Sir, I have to create multiple dynamic dropdownlist boxes and add items dynamically in <asp:table> server control but problem occurs , i.e. except of fist dropdown list no dropdownlist...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.