开发者

asp net jquery popup dialog form in asp:formview

i have following problem, i am using a popup jquery dialog with asp:formview .

the purpose of this popup is for user to enter a hyperlink which is placed then in textbox control in formview

the popup dialog div is located outside a formview just after body tag

    <body style="background-color: #FFFFFF; font-family:Lucida Console;">

        <div id="dialog-form" title="sdfdfsdf" style="font-size:14px; ">
            <form>
            <fieldset>
                <label for="li开发者_如何学运维nk">sdfdf</label>
                <input type="text" name="sdfsdf" id="link" size="32" />
            </fieldset>
            </form>
        </div>

    <form id="form1" runat="server" style="margin-top:50px;" >
    <div>

        <asp:FormView ID="FormView1"

.......
  <InsertItemTemplate>
   ...
      <sometextbox ...../>
      <button id="create-user" class="ui-state-default ui-corner-all">Create link</button>
   ...
  </InsertItemTemplate>

After clicking a button a popup window is shown BUT the page starts to refresh immediately and of course the popup is then hidden.

If I relocate the button outside the formview - the page is not refreshed, but i need it in formview..

Any idea what to do?


add the following attribute to the button:

onclick="javascript: return false;"


this behavior should not come out because it is a button not submit button.
it seems when it is inside the form view a submit action is attached to it, check your jQuery scripts maybe you mistakenly added onclick submit while attaching the dialog.


I found my answer:

clientId must be used:

FTB_API['<%=FormView1.FindControl("AdminCommentTextBox").ClientID%>'].SetHtml(...) 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜