Showing posts with label app. Show all posts
Showing posts with label app. Show all posts

Wednesday, March 28, 2012

Ajax update panel focus problem

Hi

I have a asp.net 2 web app that uses asp.net ajax and master pages. I have a very common problem that I think most people get when using an update panel and textboxes. The tab order after leaving the text box is lost, so I have heard the fix is to use

Me.ScriptManager1.SetFocus(Textbox1.ClientID);

Rather than adding the ScriptManager to every page I have added it to my Master page. However my update panel exists within a user control, which is then embeded in a master page. So the above syntax does not work in my user control as it does not know about the ScriptManager as it is defined in my master page.

Any ideas on how I could get this to work? Or any other methods to get round this textbox focus problem?

Many thanks inadvance

Use ScriptManager.GetCurrent() to get a reference to the page's ScriptManager.


See for more detail.

http://asp.net/AJAX/Documentation/Live/mref/O_T_System_Web_UI_ScriptManager_SetFocus.aspx


Hi,

You may get reference to the scriptManager instance via
ScriptManager.GetCurrent(this.Page)

Hope this helps.


I'm having a similar problem, except that I have a timer that refreshes some content every 4 seconds. I set the

this.ScriptManager1.SetFocus(tbMessage.ClientID);

but when the content refreshes, it sends the cursor to the beginning of the text box. Even when i'm in the middle of typing something.Tongue Tied

Is there a way to keep the cursor exactly where it was when content was updated in the update panel?

- Albert

(PS - Sorry to hijack this thread.)

Monday, March 26, 2012

Ajax ToolKit Version 1.0.10920.0

hey Guys,

I am facing a strange problem. Until now I was using toolkit ver 1.0.10301.0 for my app, few days back I downloaded latest version of toolkit that is ver 1.0.10920.0 and I am facing few problems.

1) I am not getting focus in Modal PopUp fields in Mozilla Firefox, in IE everything is fine.In earlier version also it works fine.

2) If I am calling message box(error message:which again is a modal PopUp) from my modal PopUp, its not getting displayed, although error message PopUp gets displayed properly if called from page. Sadly this also use to work fine in earlier version which I was using.

P.S I am not getting any Javascript error also.

please suggest, are these bugs in latest version or I am doing some mistake.

Regards,

Pankaj

I'm really not sure of the problem, but I gonna take a guess at something. When you did the upgrade and copied the new AjaxControlToolkit.dll over the previous copy and then went to your Toolbox and selected the new updated AjaxControlToolkit.dll, did you uncheck the previous reference to the 1.0.1.0310.0 controls? I'm not sure if that has anything to do with it, but there could possibly be some kind of version reference issue, if you didn't do this.

Ajax Toolkit Issues...

Hi,

i've been using ASP.net AJAX (and Atlas) for awhile and now i wanted to upload it to my site.

So, I wrote some sample Ajax app the uses the toolkit - just to see if it works at my website hoster.

First we had to install the extensions (10x for my hoster to be so nice - he installed it real quick for me)

So, all Ajax extensions works...

Now i've added just a watermark to a textbox... works greate at my dev enviroment but... nothing at my hoster/website.

it's not working, and i don't even see an error... it's like i didn't even added it...

Please, HELP!

Try view source on both versions to see if you can tell what's different in the version from from your hosting site.

Well... at the problematic site the script tags are:

<script src="http://pics.10026.com/?src=http://forums.asp.net/WebResource.axd...

at the working site the script tags are:

<script src="http://pics.10026.com/?src=http://forums.asp.net/ScriptResource.axd...

and i have:

<addverb="GET"path="ScriptResource.axd"type="Microsoft.Web.Handlers.ScriptResourceHandler"validate="false"/>

at my web config...

any clue?!?!

Thanks,

Amit


Then ASP.NET AJAX isn't configured properly. If you've followed their release notes, then you'll probably want to ask this question on their forums. One thing is to make sure you've modified the web.config correctly - there are now sections for IIS6 and IIS7 and maybe you modified the wrong one?


Speaking of which, see the last post here for what I was talking about:http://forums.asp.net/thread/1482249.aspx

Wednesday, March 21, 2012

Ajax Tab Container selected tab

I have a vb.net/asp.net 2005 app using an ajax tab container with tabs inside it.

I want the user to be able to click on a button as one way to get to the next tab. How do i display the next tab when the user clicks on a button.

Also, can I disable tabs where the user has not filled in information yet for the tab? IE: the user needs to fill in details on each tab page and the details are needed in sequence.

thanks.

Hi!

On the first one, you could put your TabContainer inside an UpdatePanel, set your button as a trigger and on the ButtonClick event set the TabContainer.ActiveTabIndex.

On the second one, you could use the same approach, using some kind of validation, catching the OnTextChangedEvent, so when you find that the user had filled up all the necessary information, you could enable a new TabPanel.
There are a couple of catchs here: Clicking on a TabPanel doesn't fire a post back to the server and I think that disabling a TabPanel won't just make it inactive, it will make it invisible. I'm not sure on the later, just give it a try.

Cherrs,

ajax stopping all events

Hi,

I'm trying to implement some ajaxfeatures in current asp application. (App has been converted to vs2005 recently).

I've already used ajax update panels with popupcontrolextenders and scriptmanager on one of the sites. But when Im trying to use similar pattern in another site

(update panel + gridview) everything stops working. By everything I mean that when I add scriptmanager control to the page, most events stop to fire at all. Only gridviews paging and sorting events work. Here some code:

<%@dotnet.itags.org. Page Language="c#" MasterPageFile="~/MasterPage.Master" Codebehind="PC_Scor_Search_Results.aspx.cs"
AutoEventWireup="True" Inherits="WBOnline.PC_Scor_Search_Results" %
<%@dotnet.itags.org. Register Assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="Microsoft.Web.UI" TagPrefix="ajaxExt" %>
<%@dotnet.itags.org. Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %> <asp:Content ID="content12" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"
<ajaxExt:ScriptManager ID="ScriptManager1" EnablePartialRendering="true" runat="server">
</ajaxExt:ScriptManager>

<asp:ObjectDataSource ID="objComboWind" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetWBNamesWithIDEmpl" TypeName="WBOnline.BLL.Dictionaries_BLL"></asp:ObjectDataSource
<table border="0"> <tr>
<td style="height: 64px">
<table cellspacing="0" cellpadding="0" width="907">
<tr>
<td class="tableDanekomorka">
</td>
<td class="tableDanekomorka" colspan="2" rowspan="1">
</td>
</tr>
<tr>
<td class="tableDanekomorka" style="height: 19px">
<asp:Label ID="lblIloscWynikow" runat="server" CssClass="pole" Height="4px" Font-Size="XX-Small" Font-Names="Verdana">Ilo?? wyników na stronie</asp:Label><asp:DropDownList ID="ddlIloscWynikowNaStronie" runat="server" Width="80px" Font-Size="XX-Small" Font-Names="Verdana">
<asp:ListItem Value="20">20</asp:ListItem>
<asp:ListItem Value="50">50</asp:ListItem>
<asp:ListItem Value="100">100</asp:ListItem>
</asp:DropDownList>
<asp:Button ID="btnOdswiez" runat="server" CssClass="przycisk" Font-Names="Verdana" Font-Size="XX-Small" OnClick="btnOdswiez_Click" Text="Od?wie?" />
<asp:Button ID="btExcel" runat="server" CssClass="przycisk" OnClick="btExcel_Click" Text="Eksport" Font-Names="Verdana" Font-Size="XX-Small" /></td>
<td class="tableDanekomorka" style="height: 19px">
<asp:Label ID="lblWindykator" runat="server" CssClass="pole" Height="4px" Font-Size="XX-Small" Font-Names="Verdana" Width="80px">Windykator:</asp:Label><asp:DropDownList ID="ddlWindykator" runat="server" Width="200px" Font-Size="XX-Small" Font-Names="Verdana" Enabled="False" DataSourceID="objComboWind" DataTextField="Nazwisko" DataValueField="IDPracownik">
</asp:DropDownList>
<asp:Button ID="btnPrzydzielWindykatora" runat="server" CssClass="przycisk" OnClick="btnPrzydzielWindykatora_Click" Text="Przydziel wszystkie" Font-Names="Verdana" Font-Size="XX-Small" /></td>
</tr>
</table
</td>
</tr>
<tr>
<td>
<div> <asp:GridView ID="gvSearchResults" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataSourceID="objSearchResults" OnSelectedIndexChanged="gvSearchResults_SelectedIndexChanged" PageSize="20" Font-Size="Small">
<Columns>
<asp:BoundField DataField="ID" HeaderText="ID" ReadOnly="True" SortExpression="ID">
<HeaderStyle CssClass="hiddencol" />
<ItemStyle CssClass="hiddencol" />
</asp:BoundField>
<asp:BoundField DataField="Regres" HeaderText="Regres" ReadOnly="True" SortExpression="Regres">
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="OrderNumber" HeaderText="Nr wew" ReadOnly="True" SortExpression="OrderNumber" />
<asp:BoundField DataField="Name" HeaderText="Windykowany" ReadOnly="True" SortExpression="Name">
<HeaderStyle Wrap="False" />
</asp:BoundField>
<asp:BoundField DataField="WindykatorID" HeaderText="WindykatorID" ReadOnly="True" SortExpression="WindykatorID">
<HeaderStyle CssClass="hiddencol" />
<ItemStyle CssClass="hiddencol" />
</asp:BoundField>
<asp:BoundField DataField="Windykator" HeaderText="Windykator" ReadOnly="True" SortExpression="Windykator">
<ItemStyle Wrap="False" />
</asp:BoundField>
<asp:BoundField DataField="DataPrzekazania" HtmlEncode="False" DataFormatString="{0:d}" HeaderText="Data przekazania" ReadOnly="True" SortExpression="DataPrzekazania">
<HeaderStyle Wrap="False" />
</asp:BoundField>
<asp:BoundField DataField="DataWizyty" HeaderText="Data wizyty" ReadOnly="True" SortExpression="DataWizyty">
<ItemStyle Wrap="False" />
<HeaderStyle Wrap="False" />
</asp:BoundField>
<asp:CheckBoxField DataField="Zamknieta" HeaderText="Zamkni?ta" SortExpression="Zamknieta" />
<asp:CommandField SelectText="Pobierz" ShowSelectButton="True" /
</Columns>
</asp:GridView>
<asp:ObjectDataSource ID="objSearchResults" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetScoringSearchResults" TypeName="WBOnline.BLL.PC_Scor_BLL" OnSelecting="objSearchResults_Selecting" EnableViewState="False">
<SelectParameters>
<asp:Parameter Name="idEmployee" Type="Int32" />
<asp:Parameter Name="orderBy" Type="String" />
<asp:Parameter Name="sortOrder" Type="String" />
</SelectParameters>
</asp:ObjectDataSource> </div>
</td>
</tr>
</table>
</asp:Content>



Solution: Install IE 7.0 (or some updates for IE6.0), install ajax rc december.

I don't see you using any UpdatePanel ... !?

WS


Damn, I posted wrong version. I did use updatepanel (it contains gridview with objectdatasource).

Problem with stopping all events disappeared, now I can't get rid of an 'sys is undefined' error.

http://forums.asp.net/thread/1503374.aspx