Showing posts with label panels. Show all posts
Showing posts with label panels. Show all posts

Wednesday, March 28, 2012

Change Tab Panel on Validation Failed.

Hai Guys,

I have 4 tab panels. The first panel contains all required fields. The other tabs having optional fields. My problem is, if some of the required fields are empty then the first tab is not shown, Its shows only currently selected tab. SetFocusOnError property is set to true in Required Field Validator. Tab container is placed inside UpdatePanel control. Please help me on this issue. Thanks in advance

Hi pbarunkumar,

The behavior you are expierencing is not the default behavior.

Could you please post a working code example which replicates this behavior? This way I can easily look into the problem!

Kind regards,
Wim


Hi Pbarunkumar,

The key to your problem is how to hide a Tab , so you should see my reply onthis thread. I have shown how to do it on the client and server side. Please be careful about the ActiveTabIndex property. When you hide the first tab, ActiveTabIndex must not be 0.

Best regards,

Jonathan

Change full postback action from inner update panel...

Hi,

Is there a way to alter full postback to partial postback caused by outer update panels from usercontrol?Huh?Confused...I tried to add button control as an AsyncPostBackTrigger. No effect to change from a full page postback to partial one. No change whether I set properties like ChildrenAsTriggers to false/true and UpdateMode to Always/Conditional inner update panel, when a button or any control causes a postback action is pressed, it causes a full postback.


Parent:

<asp:UpdatePanel ID="upanelPage" ChildrenAsTriggers="false" UpdateMode="Conditional" runat="server">
<Triggers>
</Triggers>
<ContentTemplate>
<asp:UpdatePanel ID="upanelMainContent" ChildrenAsTriggers="false" UpdateMode="Conditional" runat="server">
<Triggers>
</Triggers>
<ContentTemplate>
<!-- Main Content --> <<-- my user control or other are displayed
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</asp:UpdatePanel>

User Control loaded to Parent...

<asp:UpdatePanel ID="updatePanel1" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false" >
<ContentTemplate>
<ajaxToolkit:TabContainer ...>
<ajaxToolkit:TabPanel ...>
<asp:MultiView...>
<asp:View...>
...
<asp:LinkButton...></asp:LinkButton>
<asp:Button...></asp:Button>
<asp:UpdatePanel ...>
<Triggers>
<asp:AsyncPostBackTrigger ControlID=.../>
</Triggers>
<ContentTemplate>
...
<asp:GridView...>
</asp:GridView>
...
</ContentTemplate>
</asp:UpdatePanel>
...
</asp:View...>
<asp:View...>
...controls...
</asp:View>
</asp:MultiView>
</ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel ...>

</ajaxToolkit:TabPanel>
...
</ajaxToolkit:TabContainer>
</ContentTemplate>
</asp:UpdatePanel>

UpdatePanel causes a Full Post Back no matter what properties you set on it.

If you are looking for better performing alternatives, look out for ScriptCallbacks or JSON Based Calls and this would require "some" work compared to ourmagic updatepanel!


Huh??ConfusedScriptCallbacks?ConfusedJSon Based Calls?Hmm...Does not know what are they or how to start with them? ..thanks for the reply..


Huh??ConfusedScriptCallbacks?ConfusedJSon Based Calls?Hmm...Does not know what are they or how to start with them? I was trying to control the postback action of outer update panel from the inside user control..thanks for the reply..


Hi,den2005

I found that the following code worked.

The Page:

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

<%@. Register src="http://pics.10026.com/?src=WebUserControl2.ascx" TagName="WebUserControl2" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>UpdatePanel Tutorial</title>
<style type="text/css">
#UpdatePanel2 {
position: relative;
margin: 2% 5% 2% 5%;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ChildrenAsTriggers="False" ID="UpdatePanel1" UpdateMode="Conditional"
runat="server">
<ContentTemplate>
<fieldset>
<legend>Parent UpdatePanel</legend>Last refresh
<%=DateTime.Now.ToString() %>
<br />
<asp:Button ID="Button1" runat="server" Text="Refresh Outer Panel" />
<uc1:WebUserControl2 ID="WebUserControl2_1" runat="server" />
</fieldset>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>

The UserControl:

<%@. Control Language="C#" ClassName="WebUserControl2" %>
<asp:UpdatePanel ChildrenAsTriggers="False" ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<fieldset>
<legend>Nested UpdatePanel</legend>Last refresh
<%=DateTime.Now.ToString() %>
<br />
<asp:Calendar ID="Calendar1" runat="server"></asp:Calendar>
</fieldset>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Calendar1" />
</Triggers>
</asp:UpdatePanel>

Hope this help.

Best regards.

Jin-Yu Yin

Monday, March 26, 2012

Change a Label with HoverMenuExtender

Hi

I am using the AJAXHoverMenuExtender and it works great with panels. But I want theHoverMenuExtender1 to update a Label1 with new text andHoverMenuExtender2 to update same Label1 with another text?

Best Regards

Staffan

Staffan,


Is not clear what you want. Do you have a control inside your hoverMenu that should trigger an update to the labels or do you need your labels updated when the HoverMenu "pops-up"?

Cheers,


Sorry to be to short!

I want a Label outside the hovermenu to be updated when the hovermenu is trigged; so I don′t want a "hovering" text over the control that is triggering.

My web:
On the left side of the screen I have a lot of controls that I want the hovermenutriggering on (a mouseoverfunction).

On the right side of the screen I have explanation text of what every control (on the left) side do:
So when the user "hovers" over every control on the left side, the explantion text changes, and when no hovering is trigged the original text schould come back.

Hope I am much more clear! :)

STaffan


Hi, Staffan,

Is not clear yet what you want.

Is your lable in a updatepanel? Is the text of the lable populated with data from a database in a Asynpostback triggered by the hovermunu items?

Is the lable in the popup panel of the hovermunu?


Assuming that your lable is in an updatepanel,you can set a hidden button as an Asynpostback trigger of the Updatepanel. Then in the client mouseover events of your hovermunu items,you can fire the click event of the hidden button.In this condition,you should send the ID of the hovermenu item you clicked to the click event of the hidden button.