H
Haim
I have a web page with the reorderlist web control containing a link button
in the item template. The result of the click is dependent upon a radio
button selection made prior to the link button click. The user can update a
text field depending upon the value of the link button, or I would like to
open a different aspx page in a new window (Code Behind of Link button event
attached). I have no problems updating the literal field, and only the
literal field is refreshed. But when I try to open a new window I get the
following script error on the page:
"Sys.WebForms.pagerequestmanagerParserErrorException: The message received
from the server could not be parsed."
If I do not use an update panel, the code works fine. Or if I add a
triggers section to the update panel the code will also work, but I loose
the partial refresh when I update the text field (entire page refreshes).
This is my first attempt at an Ajax enabled web page. I assume proper
javascript will work better than my code below. Can someone give me some
hints how to capture the click in javascript so that I can run the code?
Page Source
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager><asp:UpdatePanel ID="UpdatePanel2"
runat="server">
<ContentTemplate>
<asp
ropDownList ID="PanelDDl" runat="server" Height="41px"
Width="202px"
AutoPostBack="True" DataSourceID="PanelDS"
DataTextField="PanelFullName"
DataValueField="OldPanelShortName">
</asp
ropDownList>
<cc1
ropDownExtender ID="PanelDDl_DropDownExtender" runat="server"
DynamicServicePath="" Enabled="True"
TargetControlID="PanelDDl" >
</cc1
ropDownExtender>
<cc1:ReorderList ID="ReorderList1" runat="server"
PostBackOnReorder="False" Width="196px"
DataSourceID="PanelListds"
DataKeyField="Counter" >
<ItemTemplate>
<asp:LinkButton ID="LinkButton1"
runat="server" text='<%# Eval("Counter")%>'
onclick="LinkButton1_Click"></asp:LinkButton>
</ItemTemplate>
<DragHandleTemplate> </DragHandleTemplate>
(won't work at all without this template)
</cc1:ReorderList>
<asp:ObjectDataSource ID="PanelListds"
runat="server"
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetData"
TypeName="ProposalCountersTableAdapters.GetProposalforAbstractbyPanelTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="PanelDDl"
Name="panel"
PropertyName="SelectedValue"
Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
</ContentTemplate>
(If I put a trigger here, the code will open a new window, but I
get a full refresh of this page for the other functions.)
</asp:UpdatePanel>
Code Behind for Linkbutton
Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As
System.EventArgs)
Dim myref As New GetsinglePanel.GetReview
Select Case RadioButtonList1.SelectedValue
Case "Reviews"
' Updates literal field on page - this works in all cases
Case "Proposal"
'Want to open an aspx page in a new window based on value
clicked in list
Dim myscript As String
myscript = "<script language='javascript'
type='text/javascript'>"
myscript += "window.open(" & _
"'DLProp.aspx?counter=" & sender.text &
"','win','toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1');"
myscript += "</script>"
Me.ClientScript.RegisterClientScriptBlock(Me.GetType(),
"myscript", myscript)
or
System.Web.HttpContext.Current.Response.Write(myscript)
End Select
End Sub
in the item template. The result of the click is dependent upon a radio
button selection made prior to the link button click. The user can update a
text field depending upon the value of the link button, or I would like to
open a different aspx page in a new window (Code Behind of Link button event
attached). I have no problems updating the literal field, and only the
literal field is refreshed. But when I try to open a new window I get the
following script error on the page:
"Sys.WebForms.pagerequestmanagerParserErrorException: The message received
from the server could not be parsed."
If I do not use an update panel, the code works fine. Or if I add a
triggers section to the update panel the code will also work, but I loose
the partial refresh when I update the text field (entire page refreshes).
This is my first attempt at an Ajax enabled web page. I assume proper
javascript will work better than my code below. Can someone give me some
hints how to capture the click in javascript so that I can run the code?
Page Source
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager><asp:UpdatePanel ID="UpdatePanel2"
runat="server">
<ContentTemplate>
<asp
Width="202px"
AutoPostBack="True" DataSourceID="PanelDS"
DataTextField="PanelFullName"
DataValueField="OldPanelShortName">
</asp
<cc1
DynamicServicePath="" Enabled="True"
TargetControlID="PanelDDl" >
</cc1
<cc1:ReorderList ID="ReorderList1" runat="server"
PostBackOnReorder="False" Width="196px"
DataSourceID="PanelListds"
DataKeyField="Counter" >
<ItemTemplate>
<asp:LinkButton ID="LinkButton1"
runat="server" text='<%# Eval("Counter")%>'
onclick="LinkButton1_Click"></asp:LinkButton>
</ItemTemplate>
<DragHandleTemplate> </DragHandleTemplate>
(won't work at all without this template)
</cc1:ReorderList>
<asp:ObjectDataSource ID="PanelListds"
runat="server"
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetData"
TypeName="ProposalCountersTableAdapters.GetProposalforAbstractbyPanelTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="PanelDDl"
Name="panel"
PropertyName="SelectedValue"
Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
</ContentTemplate>
(If I put a trigger here, the code will open a new window, but I
get a full refresh of this page for the other functions.)
</asp:UpdatePanel>
Code Behind for Linkbutton
Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As
System.EventArgs)
Dim myref As New GetsinglePanel.GetReview
Select Case RadioButtonList1.SelectedValue
Case "Reviews"
' Updates literal field on page - this works in all cases
Case "Proposal"
'Want to open an aspx page in a new window based on value
clicked in list
Dim myscript As String
myscript = "<script language='javascript'
type='text/javascript'>"
myscript += "window.open(" & _
"'DLProp.aspx?counter=" & sender.text &
"','win','toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1');"
myscript += "</script>"
Me.ClientScript.RegisterClientScriptBlock(Me.GetType(),
"myscript", myscript)
or
System.Web.HttpContext.Current.Response.Write(myscript)
End Select
End Sub