asp.net - Ajax Extension Works With Master Page But Not With Content Page -


i have installed ajax extension , added reference application. facing strange problem master page accept ajax extension tools content page throw error “element scriptmanager/updatepanel not known element."

my webconfig: <?xml version="1.0"?><configuration>    <system.web>   <customerrors mode="off">    </customerrors>     <authentication mode="windows"/>   <pages>     <controls>       <add tagprefix="asp" namespace="system.web.ui" assembly="system.web.extensions, version=1.0.61025.0, culture=neutral, publickeytoken=31bf3856ad364e35"/>     </controls>   </pages>    </system.web>   </configuration>   contentpage: <%@ page language="c#"  masterpagefile="~/yuva.master" autoeventwireup="true"   codebehind="picsave.aspx.cs" inherits="yuvark12.picsave" %>    <asp:content id="mypicsave" runat="server"  contentplaceholderid= "maincph" >  <table id="main" style="width:100%; height:350px; background-color:white;"><tr><td>   <asp:label id="lbl1" runat="server"></asp:label>  <asp:label id="vis" runat="server" ></asp:label>     <table id="photo" style=" margin-left:auto; margin-right:auto;">    <tr><td>          <asp:fileupload id="fileupload1" runat="server"  />     </td></tr>    <tr><td>         <input  id="imagebt"                  type="button"                 value="upload image"                 runat="server"                 onserverclick="imagebt_serverclick" style=" float:left;" />     </td></tr><tr><td style="border-style:ridge;  border-width:3px;">    <center>           <asp:image id="myimg" runat="server"                      style="width:150px;                      height:150px;"                       borderstyle="solid"                      borderwidth="1px"/>    </center>    </td></tr></table>  <!-- photo end here-->      <center>     <table><tr><td>      <asp:button id="sbtn" runat="server"                   text="submit" borderstyle="ridge"                    borderwidth="4px"                   onclick="sbtn_click" />    </td></tr></table>    </center>     </td></tr></table><!--main end here-->    </asp:content> 

what missing here?. strange ajax extension working master page not content page!. solution of it?.

yes. can use ajax in web app without installing ajax toolkit.

to use ajax in web app, there's pre-defined library can use. can find these controls under "ajax extensions" in toolbox. use script manager , update panels make partial postback server.

<form id="form1" runat="server"> <div>     <asp:scriptmanager id="scriptmanager1" runat="server">     </asp:scriptmanager>     <asp:updatepanel id="updatepanel1" runat="server">     <contenttemplate>         <asp:label id="label1" runat="server" text="label"></asp:label>         <asp:button id="button1" runat="server" text="button" />     </contenttemplate>     </asp:updatepanel>     <asp:label id="label2" runat="server" text="label"></asp:label> </div> </form> 

in above code onclick of button1 label1 passed server , not label2. controls outside update panel not go server , hence it's partial postback.

you can explore more triggers make ajax callbacks more efficient.

note: ajax toolkit advance controls, accordion, animations etc. don't need them simple ajax based web application.


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -