cannot retrieve the value from modal popup extender control?

Posted by Prabu_Spark under ASP.NET AJAX on 3/3/2014 | Points: 10 | Views : 911 | Status : [Member] | Replies : 1
Hi sir,
Tell me the steps to retrieve the value from modal popup extender control. I tried the below code to get the value from the popup, but i cant able to retrieve the value, Kindly give me the solution for this problem.


Default.aspx:
************

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

<!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></title>
</head>
<body>
<form id="form1" runat="server">
<div>

<asp:Label ID="Label1" runat="server" Text="Existing User"></asp:Label>
<asp:TextBox ID="TextBox1" runat="server" ReadOnly="True"></asp:TextBox>

<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />

<asp:ModalPopupExtender ID="Button1_ModalPopupExtender" runat="server"
DynamicServicePath="" Enabled="True" TargetControlID="Button1" DropShadow="true" PopupControlID="Panel1" OkControlID="btn_ok" CancelControlID="btn_cancel">
</asp:ModalPopupExtender>

<br />
<br />
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<br />
<br />

<br />
<br />

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Panel BackColor="ActiveBorder" ID="Panel1" runat="server">
<asp:RadioButtonList ID="RadioButtonList1" runat="server">
<asp:ListItem>Yes</asp:ListItem>
<asp:ListItem>No</asp:ListItem>
</asp:RadioButtonList>
<br />
<br />
<asp:Button ID="btn_ok" runat="server" Text="Ok" onclick="btn_ok_Click" />
&nbsp;<asp:Button ID="btn_cancel" runat="server" Text="Cancel" />
</asp:Panel>
</ContentTemplate>
<Triggers>

<asp:PostBackTrigger ControlID="btn_ok" />
<asp:PostBackTrigger ControlID="RadioButtonList1" />

</Triggers>
</asp:UpdatePanel>

</div>
</form>
</body>
</html>



Default.aspx.cs:
**************

protected void btn_ok_Click(object sender, EventArgs e)
{
TextBox1.Text = RadioButtonList1.SelectedItem.Text.ToString();
}

With regards,
J.Prabu.
[Email:prbspark@gmail.com]



Responses

Posted by: Sravan661 on: 3/3/2014 [Member] Bronze | Points: 25

Up
0
Down
Hi,
Please remove
DynamicServicePath="" 
and try
it worked for me with same code

also add new ajaxtoolkit reference

Hoe it helps you


sravan

Prabu_Spark, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response