P
PK9
I have a button at the top of my page that I have an onClick event handler
for which makes some new controls (at the bottom of my page) visible. When
the user clicks the button I make the new controls visible in the onclick
server side event handler, but I do not know how to bring the focus to the
bottom section of the page afterwards. So basically, when the user clicks
the button, everything works correctly in the onclick server side event
handler (all controls are made visible), however when the page is displayed,
the user would have to scroll down to the bottom to find the new controls.
I'm looking for a way to bring the attention to the bottom section of the
page where the new controls are. Remember that I have to use the onclick
server-side event handler to first make the controls visible.
Here is my code for doing the server-side event handling, now I need to be
able to do the client side (focusing on lstNewControl - a dropdown list):
ASP.NET/ HTML CODE:
<asp:Button ID="btnAddNewTitle" Runat="server" Text="Add New Title
OnClick="btnAddNewTitle_Click" />
.....Top of Page ....
..... contents of page ....
..... Bottom of Page ....
<asp
ropDownList ID="lstNewTitle" Runat="server" visible=false />
<asp:TextBox ID="txtNewControl" Runat="server" visible=false />
CODE-BEHIND BUTTON CLICK EVENT HANDLER CODE:
public void btnAddNewTitle_Click(object sender, System.EventArgs e)
{
lstNewTitle.visible = true;
txtNewControl.visible = true;
txtNewControl.enabled = false;
}
for which makes some new controls (at the bottom of my page) visible. When
the user clicks the button I make the new controls visible in the onclick
server side event handler, but I do not know how to bring the focus to the
bottom section of the page afterwards. So basically, when the user clicks
the button, everything works correctly in the onclick server side event
handler (all controls are made visible), however when the page is displayed,
the user would have to scroll down to the bottom to find the new controls.
I'm looking for a way to bring the attention to the bottom section of the
page where the new controls are. Remember that I have to use the onclick
server-side event handler to first make the controls visible.
Here is my code for doing the server-side event handling, now I need to be
able to do the client side (focusing on lstNewControl - a dropdown list):
ASP.NET/ HTML CODE:
<asp:Button ID="btnAddNewTitle" Runat="server" Text="Add New Title
OnClick="btnAddNewTitle_Click" />
.....Top of Page ....
..... contents of page ....
..... Bottom of Page ....
<asp
<asp:TextBox ID="txtNewControl" Runat="server" visible=false />
CODE-BEHIND BUTTON CLICK EVENT HANDLER CODE:
public void btnAddNewTitle_Click(object sender, System.EventArgs e)
{
lstNewTitle.visible = true;
txtNewControl.visible = true;
txtNewControl.enabled = false;
}