modalpopupextender and commas appearing in my textbox asp.net

后端 未结 15 473
失恋的感觉
失恋的感觉 2020-12-24 05:07

Some weird stuff is happening, I am converting an application that used to use javascript to open another web page in a tiny window for data input to use a ModalPopupExtende

相关标签:
15条回答
  • 2020-12-24 05:57

    This is pretty late reply, but I am documenting it here so that other may benefit. My Scenario

    Open user control inside jquery dialog on button click. This user control had update panel inside it and few textboxes. First time open the dialog, it worked like charm. On subsequent clicks to open the dialog, I noticed a weird behavior. I had few textboxes inside the user control(inside update panel). On any partial post back, the text of textboxes changed to current text, current text. If the value of textbox was fish, then upon any partial postbacks its changed to fish, fish.

    The reason for this was I was using jquery to open the dialog. I also appended the dialog to form upon the click of the button.

     dlg.parent().appendTo($('form:first'));
    

    So on subsequent clicks multiple user controls where appended to DOM and hence while building the post back data, there existed more than one control with same id and hence there values where appended using "," - comma.

    So my solution was simple, while closing the dialog, I just removed it from DOM

    I got hint from following link. Posting it here for future reference here

    0 讨论(0)
  • 2020-12-24 05:57

    For me the solution was to get the modal poup out of the main update panel. Once I did that the commas went away. If you truely need an update panel inside of the modal popup, create one of it's own inside that panel.
    I did not need to roll back to previous version of the toolkit.

    0 讨论(0)
  • 2020-12-24 05:59

    I had the same problem with previous values coming back comma separated. It seemed that my ok button was inside the update panel and I had it in the triggers section aswell. Removing the button from the triggers section of the updatepanel solved the problem.

    best regards - Tobias

    0 讨论(0)
提交回复
热议问题