Showing posts with label focus. Show all posts
Showing posts with label focus. Show all posts

Monday, March 26, 2012

Preserving focus on UpdatePanel update

Hello, ?I would like to be able to update an UpdatePanel?on?one?part?of?the?screen?while?users?are?writing?into?a?textbox?on?another?part?of?the?screen.

When I do that now, the textbox in which the user is entering text loses focus whenever UpdatePanel updates (once every 5 seconds on account of a Timer control within the updatepanel)

How can I preserve focus?

Yours
Andreas KnudsenIf the textbox is also within anoother Update Panel (or ths ame one), trye moving it out. In the worst case you can use Scriptmanager.SetFocus from the server side code.
If the textbox is also within anoother Update Panel (or ths ame one), try moving it out. In the worst case you can use Scriptmanager.SetFocus from the server side code.
The TextBox is outside any UpdatePanel,

I do not want to always set the focus to a?particular textbox, but to
preserve the focus on whichever textbox the user is using as the UpdatePanel happens to Update.

Is that possible at all?

Problem about area of focus

Hello frnds,

I have created Web application using AJAX control tool kit......you may view it here......

www.calstate.edu/majors


My problem here is that If I select 1 item from DropDownList(DDL) 1 and then choose DDL2 and then press search button; everything works fine.....

But now If I select other item from DDL1 again, so I want the DDL2 to be set to default value as Before ie. I want it to be to Select Major Type/Degree....so what shud be added in order to change the default value of DDL2 back to original.


Thanks ur help is highly appreciated

Hemil.

write a event for DDL1's selectedindexchanged and set the ddl2's selectedindex to 0.

And also mark enableautopostback to true for ddl1


hi,

After seen the site I think the problem is that the selected value of second DDL is remain as it is so after the search result of in the selected index chnage event of first DDL just make the SelectedValue to default means index to 0 every time then it will be work


I tried changing the same, but When I write the line in the function

protected void majorDDL_SelectedIndexChanged(object sender, EventArgs e)

it says cannot assign to majorDDL_SelectedIndexChanged becoz it is a method grp.......so where shud I write the value 0....


Could you please share your code?


C-sharp file

protected void majorDDL_SelectedIndexChanged(object sender, EventArgs e)
{
visibleOff();
searchButton.Enabled = false;

}

.aspx file

<ajaxToolkit:ToolkitScriptManager ID="ScriptManager1" runat="server" /
<label for="majorDDL" style="display:none;">Select Programs Name and Type:</label><asp:DropDownList ID="majorDDL" runat="server"
OnSelectedIndexChanged="majorDDL_SelectedIndexChanged"
AutoPostBack="True">
</asp:DropDownList
<ajaxToolkit:CascadingDropDown ID="CascadingDropDown1" runat="server"
ServiceMethod="GetDropDownContents"
UseContextKey="True"
Category="major"
LoadingText="..."
PromptText="Degree Major/ Program Name"
ServicePath="MajorsDatabase.asmx"
TargetControlID="majorDDL">
</ajaxToolkit:CascadingDropDown>
<br /><br />
<label for="typeDDL" style="display:none;">Select Programs Name and Type:</label>
<asp:DropDownList ID="typeDDL" runat="server"
OnSelectedIndexChanged="typeDDL_SelectedIndexChanged" AutoPostBack="True">
</asp:DropDownList>

<ajaxToolkit:CascadingDropDown ID="CascadingDropDown2" runat="server"
ParentControlID="majorDDL"
Category="type"
ContextKey="..."
PromptText="Degree Major/ Program Type"
ServiceMethod="GetDropDownContents"
ServicePath="MajorsDatabase.asmx"
TargetControlID="typeDDL">
</ajaxToolkit:CascadingDropDown


I want to make DROPDOWN 2 value to default ie it shud display the value of PromptText="Degree Major/ Program Type".......


I suppose this is automatically handle by extender

http://asp.net/ajax/ajaxcontroltoolkit/samples/

Wednesday, March 21, 2012

Problem in Update Progress

I want to set focus on update progress whenever any event performed in update panel.Note update progress is outside the update panel. Please reply must

MaybeProgramming UpdateProgress Controls in Client Script
is a good starting point for you.