Showing posts with label form. Show all posts
Showing posts with label form. Show all posts

Wednesday, March 28, 2012

ajax update panel

hi, I have a problem with ajax.net controls. I have a form with some field. When I click a button I validete client-side the fields and then, only if the validation is ok, the page post his data to the same page. It works fine. Now I need to add the updatecontrol (ajax.net) with the script manager. If i do this the page make the validation control and even if it is not ok the page post his data. Why?

thanks

This my be what you need.

http://weblogs.asp.net/lkempe/archive/2007/03/26/asp-net-ajax-and-asp-net-validators.aspx

AJAX Toolkit: HoverMenuExtender

I'm using the HoverMenuExtender to form nifty little formattable Tooltips for a site I'm working on. They work fantastic, except for one niggling little problem:

When the page loads, for the briefest of moments all of the tooltips are visible.

Here's one of them:

<span id="spnTooltipRSM" runat="server" class="clsCursorPointer txtRedBold">?</span>
<asp:Panel ID="pnlRSMTooltip" runat="server" CssClass="clsToolTip">
<strong>Enter Manager's Name</strong>
</asp:Panel>
<cc1:HoverMenuExtender ID="HoverMenuExtender3" runat="server"
TargetControlID="spnTooltipRSM"
PopupControlID="pnlRSMTooltip" PopupPosition="Bottom"
OffsetX="15" OffsetY="15" PopDelay="100" />

Anyone have an idea as to why the brief show & tell is going on?

Just add the attribute Style="Visibility:Hidden" to the span like this:

<span id="spnTooltipRSM" runat="server" class="clsCursorPointer txtRedBold" Style="Visibility:Hidden" >?</span>

You may also add Visibility:Hidden in your css class.

If this doesn't work try css property Display:None instead.


That span tag isn't the problem - it's the ASP:Panel where the tooltop actually sits that is the problem. the span tag with the ? in it is supposed to always be visible. the panel is supposed to only be visible on mouseover.


Hi Morydyn,

Based on your description , I think you should hide the Panel at the beginning instead of the Span. Here is the sample:

<%@. Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
<script runat="server"
</script
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<span id="spnTooltipRSM" runat="server" class="clsCursorPointer txtRedBold">?</span>
<asp:Panel ID="pnlRSMTooltip" runat="server" CssClass="clsToolTip" style="display:none">
<strong>Enter Manager's Name</strong>
</asp:Panel>
<ajaxToolkit:HoverMenuExtender ID="HoverMenuExtender3" runat="server" TargetControlID="spnTooltipRSM"
PopupControlID="pnlRSMTooltip" PopupPosition="Bottom" OffsetX="15" OffsetY="15"
PopDelay="100" />
</div>
</form>
</body>
</html>

If I have misunderstood , please let me know.
Best regards,
Jonathan

Wednesday, March 21, 2012

Ajax TabControl and validation are incompatible - any way to resolve

Hi -

I've found out that the buttons in my tab panels no longer post back when I add validation on the input form. Is there a way around this? Has anyone solved this?

Thanks for ANY help or idea how to tackle ...

Oliver

Each tab have their own buttons? if this is a case use ValidationGroup. e.g: in tab1 assign to ValidationGroup property in your validation controls and button controls to say tab1, in tab2 assign a validationgroup property of say tab2 and so on.


the content of each tab are in a user control ... I thought that would take care of it, ... thanks for the pointer

AJAX Tab Control & the menu control

Hi,

I have a Master Page with a menu control & a Tab Control on a aspx form that will be displayed as a Content.

How do I switch between the Tab Control when a click is made on the menu in the master pages?

Do you want to set the currently selected tab panel?

TabContainer1.ActiveTab = TabPanel1;

Im accessing the TabControl on the Default.aspx & this code does not work. I get no errors thou. Am I doing something wrong?

protectedvoid MenuItem_Click(object sender,MenuEventArgs e)

{

if (this.Menu1.SelectedItem.Value.Equals("1"))

{

TabContainer myTabContainer = (TabContainer)this.ContentPlaceHolder1.FindControl("TabContainer1");

TabPanel myTabPanel2 = (TabPanel)this.ContentPlaceHolder1.FindControl("TabPanel2");

myTabContainer.ActiveTab = myTabPanel2;

}

}


Try this:

protectedvoid MenuItem_Click(object sender,MenuEventArgs e)

{

if (this.Menu1.SelectedItem.Value.Equals("1"))

{

TabContainer myTabContainer = (TabContainer)this.ContentPlaceHolder1.FindControl("TabContainer1");
myTabContainer.ActiveTab = TabPanel2;

}

}


I got it working with this

using AjaxControlToolkit;

protectedvoid Menu1Item_Click(object sender,MenuEventArgs e)

{

AjaxControlToolkit.

TabContainer tc = (AjaxControlToolkit.TabContainer)this.ContentPlaceHolder1.FindControl("TabContainer1");if (this.Menu1.SelectedItem.Value =="1")

{

AjaxControlToolkit.

TabPanel tp = (AjaxControlToolkit.TabPanel)tc.FindControl("TabPanel1");

tc.ActiveTab = tp;

}

if (this.Menu1.SelectedItem.Value =="2")

{

AjaxControlToolkit.

TabPanel tp = (AjaxControlToolkit.TabPanel)tc.FindControl("TabPanel2");

tc.ActiveTab = tp;

}

}