locked
problem of updatepanel : aspx and c# RRS feed

  • Question

  • User-458598543 posted

    Hello,

    i've got a problem of updatepanel, the inside controls update but when the inside controls update,  the running site (video) is stopped.

    the code is the following : 

    <asp:ScriptManager id="ScriptManager1" runat="server" />

    <video style="z-index: 5;" id="lecteur_audiovideo2" controls="controls" controlsList="nodownload" autoplay="autoplay" onended="autofollow()" style="width: 360px; height: 100%;"></video>

    the first try :

    <div>
    <asp:UpdatePanel id="UP_1" runat="server" >
    <ContentTemplate>

    <asp:Button id="bt_test3" Text="informations" onClick="click_information" style="background-color: yellow; color: orangered; height: 46px; width: auto; border: hidden;" runat="server" />
    <input type="text" id="input_informations_titre" runat="server" style="width: 660px;" />
    </ContentTemplate>
    </asp:UpdatePanel>

    </div>

    the second try :

    <div>
    <asp:UpdatePanel id="UP_1" runat="server" updatemode="Conditional">
    <Triggers>
                <asp:AsyncPostBackTrigger controlid="bt_test3" eventname="Click" />
            </Triggers>
    <ContentTemplate>
    <input type="text" id="input_informations_titre" runat="server" style="width: 660px;" />
    </ContentTemplate>
    </asp:UpdatePanel>

    <asp:UpdatePanel id="UP_2" runat="server" updatemode="Conditional">
    <ContentTemplate>
    <asp:Button id="bt_test3" Text="informations" onClick="click_information" style="background-color: yellow; color: orangered; height: 46px; width: auto; border: hidden;" runat="server" />
    </ContentTemplate>
    </asp:UpdatePanel>

    </div>

    code behind :

    protected void click_information(object sender, EventArgs e)
    {

    ... code

    }

    well, thanks you for operational this code.

    M.A.

    Thursday, March 18, 2021 11:55 AM

Answers

  • User1535942433 posted

    Hi Rednuts72,

    According to your description and codes,I suggest you could try this:

    <div>
                <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
                <video width="320" height="240" controls="controls" autoplay="autoplay">
                    <source src="https://sample-videos.com/video123/mp4/720/big_buck_bunny_720p_1mb.mp4" type="video/mp4" />
                </video>
                <asp:UpdatePanel ID="UP_1" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <asp:Button ID="bt_test3" Text="informations" OnClick="bt_test3_Click" Style="background-color: yellow; color: orangered; height: 46px; width: auto; border: hidden;" runat="server" />
                        <input type="text" id="input_informations_titre" runat="server" style="width: 660px;" />
                        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="bt_test3" />
                    </Triggers>
                </asp:UpdatePanel>
            </div>

    Code-Behind:

    protected void bt_test3_Click(object sender, EventArgs e)
            {
                TextBox1.Text = "1";
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Record Inserted Successfully')", true);
            }

    Best regards,

    Yijing Sun

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, March 19, 2021 2:33 AM
  • User-458598543 posted

    hello,

    i resolved the problem. the error was due to a net framework problem with the handlers isapi so i repaired net framework with the command prompt "aspnet_regiis -i" and the updatepanel control with ajax scriptmanager is ok. the first code that i posted is operational.

    truly yours.

    rednuts72

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, March 19, 2021 8:00 PM

All replies

  • User-458598543 posted

    for your govern, when i click on the button "bt_test3", all the page is refreshed in place of only the updatepanel.

    the inputbox is update but the playing audio or video is stopped.

    truly yours.

    M.A.

    Thursday, March 18, 2021 8:43 PM
  • User1535942433 posted

    Hi Rednuts72,

    According to your description and codes,I suggest you could try this:

    <div>
                <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
                <video width="320" height="240" controls="controls" autoplay="autoplay">
                    <source src="https://sample-videos.com/video123/mp4/720/big_buck_bunny_720p_1mb.mp4" type="video/mp4" />
                </video>
                <asp:UpdatePanel ID="UP_1" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <asp:Button ID="bt_test3" Text="informations" OnClick="bt_test3_Click" Style="background-color: yellow; color: orangered; height: 46px; width: auto; border: hidden;" runat="server" />
                        <input type="text" id="input_informations_titre" runat="server" style="width: 660px;" />
                        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="bt_test3" />
                    </Triggers>
                </asp:UpdatePanel>
            </div>

    Code-Behind:

    protected void bt_test3_Click(object sender, EventArgs e)
            {
                TextBox1.Text = "1";
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Record Inserted Successfully')", true);
            }

    Best regards,

    Yijing Sun

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, March 19, 2021 2:33 AM
  • User-458598543 posted

    i do the same code that you indicated to me but i've got the same problem, when i click on the button bt_test3, the page is reloaded and the video tag playing is broken.

    thanks you.

    M.A.

    Friday, March 19, 2021 3:09 AM
  • User2012850765 posted

    Thanks. I have benefited too.

    Friday, March 19, 2021 5:05 AM
  • User-458598543 posted

    i'm trying the code on an other computer and the updatepanel is operational without reloading the page. these computers have the same os windows and the same net.framework so where is the problem ?

    thanks you.

    M.A.

    Friday, March 19, 2021 5:21 AM
  • User1535942433 posted

    Hi Rednuts72,

    As far as I think,you could check:

    1.If there are differences with two codes?

    2.How do you open two codes?IE Browser?Local Host?

    Best regards,

    Yijing Sun

    Friday, March 19, 2021 5:49 AM
  • User-458598543 posted

    there is no difference with the code. I launched the application with internet explorer (edge).

    truly yours.

    M.A.

    Friday, March 19, 2021 8:22 AM
  • User-458598543 posted

    for resolve the problem, I decided to delete few services of IIS 7.0 to have the same IIS configuration with the other computer.

    but hawful, when I launched a site, I've got a new error message, http 500 error, I posted a question about this problem on forums.asp.net. I come again to you when I should resolved this problem.

    M.A.

    Friday, March 19, 2021 8:35 AM
  • User-943250815 posted

    updatepanel is operational without reloading the page. these computers have the same os windows and the same net.framework so where is the problem ?

    If everything is same on both, the last resort can be "ASP.NET Temporary files".
    Check here to know about https://stackoverflow.com/questions/450831/what-is-the-temporary-asp-net-files-folder-for

    Your ASP.NET Temporary files can be at
    c:\Users\[youruserid]\AppData\Local\Temp\Temporary ASP.NET Files
    C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files
    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files


    Friday, March 19, 2021 12:56 PM
  • User-458598543 posted

    hello,

    i resolved the problem. the error was due to a net framework problem with the handlers isapi so i repaired net framework with the command prompt "aspnet_regiis -i" and the updatepanel control with ajax scriptmanager is ok. the first code that i posted is operational.

    truly yours.

    rednuts72

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, March 19, 2021 8:00 PM