Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

how to use Updatepanel control on custom web page in crm2011?

$
0
0

WebForm1.aspx:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" EnableViewState="true"
    Inherits="WebApplication1.WebForm1" %>

<!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>
    <base target="_self" />
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
        <div>
            <asp:DropDownList ID="DropDownList1" runat="server" Width="150px" AutoPostBack="true"
                OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
            </asp:DropDownList>
        </div>
        <div>
          
        <asp:UpdatePanel ID="update" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
             <asp:TextBox ID="txtShow" runat="server"></asp:TextBox></div>
            </ContentTemplate>
            <Triggers>
         <asp:AsyncPostBackTrigger ControlID="DropDownList1" EventName="SelectedIndexChanged" />
            </Triggers>
        </asp:UpdatePanel>
        <div>
            <asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click"
                Style="height: 21px" /></div>
    </div>
    </form>
</body>
</html>

WebForm1.aspx.cs

        private static string globeParameter = string.Empty;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                globeParameter = "start";
                List<ListItem> item = new List<ListItem>()
                {
                     new ListItem() { Text = "one", Value = "1", Selected=true},
                     new ListItem() { Text = "two", Value = "2" },
                     new ListItem() { Text = "three", Value = "3" }
                };
                DropDownList1.Items.AddRange(item.ToArray());
            }
        }

        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            txtShow.Text = "Hello-" + globeParameter;
        }

        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            txtShow.Text = DropDownList1.SelectedValue; ;
        }

It works OK running in visual studio 2011, the textbox which in the updatepanel will change when select different dropdownlist items,

but the textbox cannot refresh when I generate and publish it in the ISV folder in the CRM.

I almost search all the forum for this problem, but nobody get a solution.

somebody said that need to configurate the web.config in my application, but I don't know how to configurate it.

Hope someone could help me, thanks in advance.


Viewing all articles
Browse latest Browse all 8223

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>