Hello,
I have a page where I am using tooltips to change items like this:
Contact E-mail: me@somewhere.com change <--clicking change brings up a tooltip with the textbox to change the e-mail address.
I have a conundrum. Using the tooltip with RenderInPageRoot set to false, my tooltip will appear in the incorrect position, then "jump" up next to the element. This is due to the way my styles are defined, and unfortunately I cannot change them. However, ajax postbacks work great in this scenario.
However, if I use RenderInPageRoot=true, the tooltip shows up perfectly next to the element, but then I get the behavior where Ajax will work on the first postback, not on the next, then again on the next. So it alternates between partial and full postbacks.
Here is a snippet of the code:
Here is the AjaxManager setup (pnlContactInfo surrounds all the code that you see in the snippet above):
Here is the javascript function that is called when the user clicks the "Change" button:
And here is the code-behind that is happening on save:
Any help would be greatly appreciated.
Thanks,
Gene
I have a page where I am using tooltips to change items like this:
Contact E-mail: me@somewhere.com change <--clicking change brings up a tooltip with the textbox to change the e-mail address.
I have a conundrum. Using the tooltip with RenderInPageRoot set to false, my tooltip will appear in the incorrect position, then "jump" up next to the element. This is due to the way my styles are defined, and unfortunately I cannot change them. However, ajax postbacks work great in this scenario.
However, if I use RenderInPageRoot=true, the tooltip shows up perfectly next to the element, but then I get the behavior where Ajax will work on the first postback, not on the next, then again on the next. So it alternates between partial and full postbacks.
Here is a snippet of the code:
<div class="block append-bottom-sm"> |
<div class="span-6"> |
<asp:Label ID="lblContactEmailTitle" runat="server" Text="Contact E-mail:" AssociatedControlID="lContactEmail" /> |
</div> |
<div class="span-5"> |
<asp:Label ID="lContactEmail" runat="server"></asp:Label> |
<telerik:RadToolTip runat="server" ID="radttContactEmail" HideEvent="FromCode" Position="MiddleLeft" |
Width="250px" Height="70px" Animation="Slide" ShowEvent="OnClick" ShowDelay="0" RenderInPageRoot="true" |
RelativeTo="Element" TargetControlID="lbContactEmail"> |
<asp:Label ID="Label5" runat="server">Please enter your Contact Email:</asp:Label> |
<br /> |
<asp:TextBox ID="tbContactEmail" runat="server" ValidationGroup="ContactEmailValidationGroup"></asp:TextBox> |
<br /> |
<asp:RegularExpressionValidator ID="revContactEmail" runat="server" ValidationGroup="ContactEmailValidationGroup" Display="Dynamic" |
ValidationExpression="^[\w\.\-]+@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]{1,})*(\.[a-zA-Z]{2,3}){1,2}$" |
ControlToValidate="tbContactEmail">The Contact Email must have a valid format.</asp:RegularExpressionValidator> |
<asp:LinkButton ID="lbContactEmailSave" runat="server" ValidationGroup="ContactEmailValidationGroup">Save</asp:LinkButton> |
<asp:LinkButton ID="lbContactEmailCancel" runat="server" ValidationGroup="" CausesValidation="false" OnClientClick="HideTooltip(); return false;">Cancel</asp:LinkButton> |
</telerik:RadToolTip> |
</div> |
<div class="span-3"> |
<asp:LinkButton ID="lbContactEmail" runat="server" OnClientClick="SetContactEmail();">Change</asp:LinkButton> |
</div> |
</div> |
Here is the AjaxManager setup (pnlContactInfo surrounds all the code that you see in the snippet above):
<telerik:RadAjaxLoadingPanel ID="radalp" runat="server" BackgroundPosition="Center" Skin="Default" /> |
<telerik:RadAjaxManager ID="radam" runat="server" EnablePageHeadUpdate="false" DefaultLoadingPanelID="radalp" > |
<AjaxSettings> |
<telerik:AjaxSetting AjaxControlID="lbContactEmailSave"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="pnlContactInfo" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
</AjaxSettings> |
</telerik:RadAjaxManager> |
Here is the javascript function that is called when the user clicks the "Change" button:
function SetContactEmail() { |
document.getElementById('<%=tbContactEmail.ClientID%>').value = document.getElementById('<%=lContactEmail.ClientID%>').innerHTML; |
Page_ClientValidate('ContactEmailValidationGroup'); // Erase any message which may have been displayed the last time after a Cancel was clicked. |
} |
And here is the code-behind that is happening on save:
Private Sub lbContactEmailSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lbContactEmailSave.Click |
Dim VZID As String = hidVZID.Value |
Dim newEmail As String = tbContactEmail.Text |
Dim SQL As String = 'some sql here... |
Dim myData As New clsData() |
myData.ExecuteSQL(SQL, CommandType.Text) |
lContactEmail.Text = newEmail |
End Sub |
Any help would be greatly appreciated.
Thanks,
Gene