Click here to Skip to main content
15,890,579 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have create one page including 2 updatepanel and 3 fieldset because I'm going to have partial refreshing at this page.
the main menu located at the fieldset at updatepanel1 and sub-menu located at filedset at updatepanel2.
I want to send the data from fieldset at the updatepanel1 to other fieldset at the updatepanel2, but i want to make all the data which have received at the updatepanel2 as hyperlink, because these are sub-menus.
then by click at the any of these hyperlinks sub-menu refresh the third fieldset and show the details of this sub-menu.
could you please help me to over come this problem, specially for receiving the data as hyperlink at the second fieldset.
Appreciate your consideration.
Posted

1 solution

You can write trigger between updatepanel1 and updatepanel2 as:
XML
<form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <asp:UpdatePanel runat="server" id="UpdatePanel" updatemode="Conditional">
    <Triggers>
        <asp:AsyncPostBackTrigger controlid="UpdateButton2" eventname="Click" />
    </Triggers>
 
Share this answer
 
Comments
Far sh 31-Oct-11 3:46am    
actually when i pass the data to second part, i want to show them as hyperlink be cause the second part is the sub-menu, then once the user click on the sub-menu the third part has to be refresh and show the details of the sub-menu.
here is my sample page code:
Process details: you can type something at the textbox then click at the Send Value button, the value will appear at the second panel, once you click at the pass the value button it will appear at the third panel.
i just want to show the data which has been sent from panel 1 to panel 2 as hyperlink then by click at the hyperlink refresh the third panel and show the details of the sub-menu.

Default.aspx:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" Debug="true" %>
<!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 runat="server">
<title>Sample Partial Refresh</title>
<script type= "text/javascript">


</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager EnablePartialRendering="true" ID="ScriptManager1" runat="server">
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<contenttemplate>
<fieldset style="width:97%">
Panel 1
<asp:Label ID="Label1" runat="server" Text="This is a label!">
<br />
<asp:TextBox ID="TextBox1" runat="server">
<asp:Button ID="Button3" runat="server" Text="Send Value" onclick="Button3_Click" />
<br />
<asp:Button ID="Button1" runat="server" Text="Click Me" OnClick="Button1_Click" />
<asp:Button ID="Button2" runat="server" Text="Update This Panel" OnClick="Button2_Click" />
</fieldset>



<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
<contenttemplate>
<fieldset style=" width:20%; display:inline">
Panel 2
<asp:Label ID="Label4" runat="server">
<asp:Label ID="Label5" runat="server">
<asp:Label ID="Label2" runat="server" ForeColor="red" Text="Receive from Panel1" />
<asp:Button ID="Button4" runat="server" Text="Pass the value" onclick="Button4_Click" />
</fieldset>

<fieldset style="width:75%; display:inline">
Panel 3
<asp:Label ID="Label3" runat="server" ForeColor="blue" Text="Receive from Panel2" />
</fieldset>


<Triggers>
<asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
<asp:AsyncPostBackTrigger ControlID="Button3" EventName="Click" />
</Triggers>


</div>
</form>
</body>
</html>
-------------------------------------
Default.aspx.cs:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = DateTime.Now.ToLongTimeString();
Label2.Text = DateTime.Now.ToLongTimeString();


}
protected void Button2_Click(object sender, EventArgs e)
{
Label1.Text = DateTime.Now.ToLongTimeString();
}
protected void Button3_Click(object sender, EventArgs e)
{

if (TextBox1.Text == "m1")
{
Label4.Text = TextBox1.Text.ToString();
Labe

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900