Ask a Question related to ASP.NET General, Design and Development.
-
Jesse #1
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!
Jesse Guest
-
TabIndex and AutoPostBack
I have a long form that includes several fields which require AutoPostBack=True. I want the user to be able to tab through the fields in sequence... -
no AutoPostBack for Grid?
I have a grid with a select button. I went to turn off AutoPostBack and there is no such attribute. Is there any way to make a grid behave as... -
AutoPostBack
I have another question. On my page there is a datagrid and in a templatecolumn it contains a dropdownlist. The AutoPostBack property of the... -
AutoPostBack question.
Hi, I'm having a straight HTML <input type="text" onkeypress="CheckKey();"> within a <form runat="server">. When I press ENTER when in the... -
Can NOt AutoPostBack for two DDL
Can NOt AutoPostBack for two DDL Posted: 07-03-2003 01:35 AM I have a usercontrol a.ascx ,put two DDL on the ascx. in an aspx's codebehind... -
Natty Gur #2
Re: Problem with Autopostback
Hi,
Turn the smartnavigation on.
[url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h[/url]
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 [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Natty Gur Guest
-
Jason Turim #3
Re: Problem with Autopostback
Add the following to the page directives, it works for ie5 and above maybe
others
<%@Page ... SmartNavigation="true"%>
"Jesse" <jesselch@hotmail.com> wrote in message
news:eUeqcPBTDHA.2852@tk2msftngp13.phx.gbl...subsequent> I have a relatively long page with a number of webcontrols with
> "autopostback" set to true. The contents/items/datasources of theprevious> webcontrols are dynamically populated depending on the selection ofdue> webcontrols' selected item.
>
> My question is : everytime the user selects an option from a webcontrol,selected> 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> 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!
>
>
Jason Turim Guest
-
Jos Branders #4
Re: Problem with Autopostback
"Jesse" <jesselch@hotmail.com> wrote in message
news:eUeqcPBTDHA.2852@tk2msftngp13.phx.gbl...subsequent> I have a relatively long page with a number of webcontrols with
> "autopostback" set to true. The contents/items/datasources of theprevious> webcontrols are dynamically populated depending on the selection ofdue> webcontrols' selected item.
>
> My question is : everytime the user selects an option from a webcontrol,selected> 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 lastTo make a workaround in other browsers apart from IE5 and 6, you could> 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?
think of inserting a numbered bookmark with each control:
<a name="bookmark01"> </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
Jos Branders Guest
-
Jesse #5
Re: Problem with Autopostback
Thank you Natty Gur!
Thank you Jason Turim!
Thank you Jos Branders!
You guys just saved my life!!!
"Jesse" <jesselch@hotmail.com> wrote in message
news:eUeqcPBTDHA.2852@tk2msftngp13.phx.gbl...subsequent> I have a relatively long page with a number of webcontrols with
> "autopostback" set to true. The contents/items/datasources of theprevious> webcontrols are dynamically populated depending on the selection ofdue> webcontrols' selected item.
>
> My question is : everytime the user selects an option from a webcontrol,selected> 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> 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!
>
>
Jesse Guest
-
mo #6
Problem with Autopostback
Hi,
I have a set of Dynamic DropDownLists with AutoPostback. the problem I
have is that when I select the dropdown and the page refreshes the old
values in the text boxes disappear. Is there a way to preserve the
values?
Thanks,
Mo
mo Guest
-
Jorge Matos #7
RE: Problem with Autopostback
Make sure you are not accidentally re-initializing your controls. All
controls have viewstate to maintain their values, and therefore in your
Page_Load event you need to make sure you only initialize your drop-downs
when the page is first being requested via HTTP GET request and not during an
HTTP POST request.
inside Page_Load:
public void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
//Initialize drop downs here
}
}
"mo" wrote:
> Hi,
>
> I have a set of Dynamic DropDownLists with AutoPostback. the problem I
> have is that when I select the dropdown and the page refreshes the old
> values in the text boxes disappear. Is there a way to preserve the
> values?
>
> Thanks,
> Mo
>Jorge Matos Guest



Reply With Quote

