views:

154

answers:

2

hi my dear friends

My Pages Base on Master And Content Pages And In Content Pages I have multiviews And inside Multiviews I have RadComboBoxes.

two of my radcomboboxes are parent and child like country and city dropdowns... therefore in codebehind i put some codes in the OnSelectedIndexChange event of Parent RadComboBox for filling it's child - I used a hidden field for country id and sql datasources(stored Procedures)...

meantime parent and child combo boxes are in an update panel

for doing this job i set the autopostback property of parent combobox to true... but i do not want that autopostback=ture because of some focus problems that i coded with jquery

so i want convert OnSelectedIndexChange event in codebehind to a method and call it in jquery(in change event or something like that of parent combobox)

how can i do this job? best regards

+2  A: 

By $.ajax and by declaring your method a WebMethod

David Hedlund
A: 

really thanks i read and enjoy your link and test it - that works

==========================================================================

but i have a big problem:

" so i want convert OnSelectedIndexChange event in codebehind to a method and call it in jquery(in change event or something like that of parent combobox) "

at now that method is like this :

    [WebMethod]
public static void RadcbPesonelNumberInInsert_OnClientFocus_CSharp()
{

    hfSelectedCo_ID.Value = RadcbCoNameInInsert.SelectedValue;
    RadcbPesonelNumberInInsert.Items.Clear();
    RadcbPesonelNumberInInsert.Items.Add(new RadComboBoxItem("Empty", "5"));
    RadcbPesonelNumberInInsert.DataBind();
    RadcbPesonelNumberInInsert.SelectedIndex = 0;

}

after that i recieved this error about any of controls in this method :

Error 2 An object reference is required for the non-static field, method, or property 'Darman.SuperAdmin.Users.hfSelectedCo_ID' C:\Javad\Copy of Darman 6\Darman\SuperAdmin\Users.aspx.cs 231 13 Darman

i can not remove static from this method , Because by doing that i can not call this method from jquery///

what can i do?

thanks a lot

LostLord