linkbutton serving as okcontrolid for modalpop, won't fire click event

Last post 11-30-2008 10:54 PM by orion846. 2 replies.

Sort Posts:

  • linkbutton serving as okcontrolid for modalpop, won't fire click event

    11-30-2008, 9:46 PM
    • Member
      58 point Member
    • orion846
    • Member since 12-28-2006, 9:39 AM
    • Posts 347

    my problem is that i have a div as a modalpopup, with a linkbutton inside of it. so user clicks another linkbutton, gets this pop, clicking this linkbutton postbacks a sql update command. works fine when i set no okcontrolid, but when i don't the entire page postsback and refreshes and is very ugly. isntead i want the instant effect of setting that linkbutton as the okcontrolid, just making the pop instantly go away and no visible postback. the problem is when i set it, it no longer postsback to use its code behind to do the sql update.

    can anyone help? how can i have the same linkbutton serving as a modal's okcontrolid, ALSO postback when clicked? 

  • Re: linkbutton serving as okcontrolid for modalpop, won't fire click event

    11-30-2008, 10:43 PM
    Answer

    Well you can try closing your modalpopup through code behind.

    Basically remove the okcontrolid and assign your linkbuttons click event to your delete sql method. Then at the end of your delete method. call modalpopup1.hide(); this also works to show a popup programically with modalpopup1.show();

    Additionally you could write a nice asmx webservice that wraps to your close control of your modalpopup. Therefore you could do it all with out even posting back.

     

    Try the first method out as it is by far the easiest.

  • Re: linkbutton serving as okcontrolid for modalpop, won't fire click event

    11-30-2008, 10:54 PM
    • Member
      58 point Member
    • orion846
    • Member since 12-28-2006, 9:39 AM
    • Posts 347

    i'll try this and let you know how it goes, thanks! 

Page 1 of 1 (3 items)