Asp.net UpdatePanel Repeater ObjectDataSource获取错误
我开发了一个应用程序,其中使用了UpdatePanel、Repeater和ObjectDataSource 问题是,当我使用这三个时,我得到了一个错误,如 “Sys.WebForms.PageRequestManagerServerErrorException:调用目标已引发异常。” 这个问题只在IE8中出现,在本地没有出现。我是说我的本地机器在IE8中工作正常,但当我在IIS上托管应用程序时,IE8创建了一个问题,所有浏览器都工作正常。 下面提到的代码Asp.net UpdatePanel Repeater ObjectDataSource获取错误,asp.net,ajax,updatepanel,asprepeater,Asp.net,Ajax,Updatepanel,Asprepeater,我开发了一个应用程序,其中使用了UpdatePanel、Repeater和ObjectDataSource 问题是,当我使用这三个时,我得到了一个错误,如 “Sys.WebForms.PageRequestManagerServerErrorException:调用目标已引发异常。” 这个问题只在IE8中出现,在本地没有出现。我是说我的本地机器在IE8中工作正常,但当我在IIS上托管应用程序时,IE8创建了一个问题,所有浏览器都工作正常。 下面提到的代码 <asp:HiddenField
<asp:HiddenField runat="server" ID="hdnKey" Value="mainAlt" />
<qfx:label runat="server" ID="Label1" CssClass="subHeading" Text="term_Shares"></qfx:label>
<asp:Repeater ID="rptShareTypeList" runat="server">
<HeaderTemplate>
</HeaderTemplate>
<ItemTemplate>
<div class="shareItem">
<span class="shareItemButton"></span>
<span class="shareItemLabel">
<%#IRAppMgr.Translate(Convert.ToString(Eval("title"))) %>
<input style="display: none" class="ShareTypeCheckBox" type="checkbox" name='<%# Eval("key") %>' value="<%#Eval("Code") %>" <%# Eval("checked12") %> />
<input class="ShareColor" type="hidden" value="<%#Eval("Color") %>" />
<input class="ShareCurrency" type="hidden" value="<%#Eval("Currency") %>" />
</span>
</div>
</ItemTemplate>
<FooterTemplate></FooterTemplate>
</asp:Repeater>
<asp:ObjectDataSource ID="SharesTypeDS" runat="server" DataObjectTypeName="Qfx.DataClasses.Config.Option"
SelectMethod="SelectShareType" TypeName="Qfx.Bases.data.DataManager">
<SelectParameters>
<asp:ControlParameter ControlID="ClientMarker" Name="appConfig" PropertyName="Config"
Type="Object" />
<asp:ControlParameter ControlID="ClientMarker" Name="client" PropertyName="Client" />
<asp:Parameter Name="selection" DefaultValue="ShareType" />
</SelectParameters>
</asp:ObjectDataSource>
我的InstrumentSelectionBox.ascx控件中的上述代码
在我的Qfx.base.data.DataManager类中
public List<Option> SelectShareType(object appConfig, string client, string selection, string ShareKey)
{
AppConfig config = (AppConfig)appConfig;
List<Option> Options = null;
if (config.getSelectionByKey(ShareKey + selection) != null)
Options = config.getSelectionByKey(ShareKey + selection).Options;
if (Options != null && Options.Count > 0)
{
foreach (Option option in Options)
{
if (option.Currency == null && IRAppManager.Manager != null)
{
DataClasses.Share.Instrument inst = IRAppManager.Manager.GetInstrument(option.Key);
option.Currency = (inst != null) ? IRAppManager.Manager.Translate(inst.Currency) : "";
}
if (option.VolumeDivisor == null || option.VolumeDivisor.Trim() == string.Empty)
option.VolumeDivisor = option.VolumeValue;
option.Code = (config.GetDataSourceByKey(option.Key) != null) ? config.GetDataSourceByKey(option.Key).Code : "";
if (option.Code != string.Empty)
{
option.TimeStamp = GetTimeStampDetail(option.Code);
}
}
}
return (config.getSelectionByKey(ShareKey + selection) != null) ? config.getSelectionByKey(ShareKey + selection).Options : new List<Option>();
}
public List SelectShareType(对象appConfig、字符串客户端、字符串选择、字符串共享键)
{
AppConfig config=(AppConfig)AppConfig;
列表选项=null;
if(config.getSelectionByKey(ShareKey+selection)!=null)
Options=config.getSelectionByKey(ShareKey+selection).Options;
如果(选项!=null&&Options.Count>0)
{
foreach(选项中的选项)
{
if(option.Currency==null&&IRAppManager.Manager!=null)
{
DataClasses.Share.inst=IRAppManager.Manager.GetInstrument(option.Key);
option.Currency=(inst!=null)?IRAppManager.Manager.Translate(inst.Currency):“”;
}
if(option.VolumeDivisor==null | | option.VolumeDivisor.Trim()==string.Empty)
option.VolumeDivisor=option.VolumeValue;
option.Code=(config.GetDataSourceByKey(option.Key)!=null)?config.GetDataSourceByKey(option.Key)。代码:“”;
if(option.Code!=string.Empty)
{
option.TimeStamp=GetTimeStampDetail(option.Code);
}
}
}
返回(config.getSelectionByKey(ShareKey+selection)!=null)?config.getSelectionByKey(ShareKey+selection)。选项:新建列表();
}
我在Updatepanel中使用了它
<asp:UpdatePanel ID="upTab" runat="server">
<ContentTemplate>
<uc:InstrumentSelectionBoxrunat="server" ID="UTCInstrumentSelectionBox"></uc:InstrumentSelectionBoxrunat>
</ContentTemplate>
</asp:UpdatePanel>
在浏览器控制台中进行了一些调试之后,我认为由于ObjectDataSource的原因出现了错误,所以我已经删除了ObjectDataSource,并用Id绑定了repeater normal,然后它在IE8中正常工作
所以,如果IE8在使用ObjectDataSource时有任何限制,或者我的代码有错误,请任何人帮助我。
你的回答应该得到高度评价。
谢谢使用反射来调用函数/方法。在特殊情况下,您的方法可能会给出异常。这是问题,请检查并调试您的方法。我已经测试了它。应用程序不仅可以运行IE8,我是否需要为它添加任何元标记。您是否调试了您的方法,调用中没有任何异常/innerexception。是的,我已经调试了它,在一个地方我遇到了错误,比如在IE8中对象引用未设置为对象实例,而在其他浏览器中未设置。请将EnableCaching设置为True,我不确定,但这与缓存或UpdatePanel有关。请试一试。嘿,谢谢你的帮助。由于一个js,问题已经解决了