spero che ci sia ancora qualcuno che guarda questo thread...
non venendone fuori ho ridotto tutto all'osso ho fatto un test molto semplice
ASPX
codice:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="test1.aspx.vb" Inherits="FrontEndASCX_test_test1" %>
<%@ Register TagPrefix="UC" TagName="UCControl" Src="~/FrontEndASCX/test/test.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title> </head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager>
<telerik:radajaxmanager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="DropDownList1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:radajaxmanager>
<asp:DropDownList ID="DropDownList1" runat="server">
</asp:DropDownList>
<asp:UpdatePanel ID="myPanel" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<UC:UCControl id="UCControl1" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>
ASPX.vb
codice:
Partial Class FrontEndASCX_test_test1 Inherits System.Web.UI.Page
Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
fillCombo()
End Sub
Private Sub fillCombo()
Dim a As New List(Of Long)
a.Add(1)
a.Add(2)
a.Add(3)
a.Add(4)
DropDownList1.AutoPostBack = True
DropDownList1.DataSource = a
DropDownList1.DataBind()
End Sub
Protected Sub DropDownList1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.TextChanged
'UCControl1.IDCart = 1
UCControl1.setCart(DropDownList1.SelectedValue)
End Sub End Class
ASCX
codice:
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="test.ascx.vb" Inherits="FrontEndASCX_test_test" %>
<asp:Label ID="Label1" runat="server" Text="__"></asp:Label>
ASCX.vb
codice:
Partial Class FrontEndASCX_test_test Inherits System.Web.UI.UserControl
Dim myidcart As Long
Public Property IDCart() As Long
Get Return myIDCart
End Get
Set(ByVal value As Long)
myidcart = value
End Set
End Property
Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
Label1.Text += "Page_Init " & IDCart
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Label1.Text += "Page_Load " & IDCart
End Sub
Public Sub setCart(ByVal parCart As Long)
IDCart = parCart
Label1.Text += "setCart " & parCart
End Sub
End Class
come metto ajaxato il controllo combo (nel mio caso reale è una radgrid ma credo che il test vada bene uguale) non funziona più niente.
cosa avrei dovuto scrivere per farlo funzionare con ajax??
Grazie