在同一页面上使用AJAX CONTROL TOOLKIT时,ScriptManager.RegisterClientScript中的SYNTAX ERROR。 [英] SYNTAX ERROR IN ScriptManager.RegisterClientScript when using AJAX CONTROL TOOLKIT on the same page .

查看:42
本文介绍了在同一页面上使用AJAX CONTROL TOOLKIT时,ScriptManager.RegisterClientScript中的SYNTAX ERROR。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我正在使用ScriptManager.RegisterClientScript显示来自代码的警告消息。最初它的工作应该是,但是当我在页面上使用ajax控件工具包时它不工作并显示语法错误意外的标识符.. ..



这里我附上了我的代码...



HTML PAGE SOURCE .... < br $> b $ b

Hi all, I am showing an alert message from code behind using ScriptManager.RegisterClientScript .Initially its working as it should be but when i used a ajax control toolkit on the page its not working and showing a syntax error enexpected identifier ....

here i attached my code ...

HTML PAGE SOURCE ....

<%--Balloon Popup--%>
                                                               <asp:BalloonPopupExtender

                                                                   ID="BalloonPopupExtender1"

                                                                   runat="server"

                                                                   BalloonPopupControlID="pnlBalloonPopup"

                                                                   TargetControlID="coapplicantsTD"

                                                                   Position="TopRight"

                                                                   BalloonStyle="Rectangle">
                                                               </asp:BalloonPopupExtender>

                                                               <td class="coapplicants" runat="server" id="coapplicantsTD">
                                                                   <asp:Panel runat="server" style="display:none;" ID="pnlBalloonPopup" CssClass="pnlballoon">
                                                                   <table border="1" style="width: 100%; border-collapse: collapse;">
                                                                       <tr runat="server"  id="noitems" >
                                                                           <td colspan="4" style="font-size:15px;">
                                                                               No Co-Applicants added.
                                                                           </td>
                                                                       </tr>
                                                                       <asp:Repeater runat="server" ID="rptCoapplicants">
                                                                           <HeaderTemplate>
                                                                               <tr>
                                                                                   <td>Sl. No.</td>
                                                                                   <td>Co-Applicant Name</td>
                                                                                   <td>Co-Applicant Father's Name</td>
                                                                                   <td>Co-Applicant's Voter Id</td>
                                                                               </tr>
                                                                           </HeaderTemplate>
                                                                           <ItemTemplate>
                                                                               <tr>
                                                                                   <td><span><%#Eval("SerialNo") %></span></td>
                                                                                   <td><span><%#Eval("CoApplicantName") %></span></td>
                                                                                   <td><span><%#Eval("CoApplicantFatherName") %></span></td>
                                                                                   <td><span><%#Eval("CoApplicantVoterId") %></span></td>
                                                                               </tr>
                                                                           </ItemTemplate>
                                                                       </asp:Repeater>
                                                                   </table>
                                                               </asp:Panel>
                                                                   <span>Click To Show</span></td>

                                                               <%--End--%>





代码背后





Code Behind

ScriptManager.RegisterStartupScript(this, this.GetType(), "errormsg", "alert('CLUSTER FROM A SINGLE GP AT A TIME !!!!')", true);

推荐答案

无法在页面上看到Ajax脚本管理器,要使Ajax在asp.net中工作,您应该注册脚本管理器。欲了解更多信息:

https://msdn.microsoft.com/en- us / magazine / cc163354.aspx [ ^ ]
Can't see the Ajax script manager on page, for Ajax to work in asp.net, you should have Script manager registered. For more info:
https://msdn.microsoft.com/en-us/magazine/cc163354.aspx[^]


更改您的代码...

Change your code...
ScriptManager.RegisterStartupScript(this, this.GetType(), "errormsg", "alert('CLUSTER FROM A SINGLE GP AT A TIME !!!!')", true);



to ...


to...

ScriptManager.RegisterStartupScript(this, this.GetType(), "errormsg", "alert('CLUSTER FROM A SINGLE GP AT A TIME !!!!');", true);



只是一个分号,你很好。



这是因为将遵循的代码渲染时此行无效,因为由于缺少分号,此行无效。


Just a semicolon and you are good.

This is because the code which will follow this line when rendered won't work because this line is invalid due to the missing semicolon.


这篇关于在同一页面上使用AJAX CONTROL TOOLKIT时,ScriptManager.RegisterClientScript中的SYNTAX ERROR。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆