Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. update panel in content page works just on first time click?

update panel in content page works just on first time click?

Scheduled Pinned Locked Moved C#
sysadmintoolshelpquestionannouncement
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • 2 Offline
    2 Offline
    2208
    wrote on last edited by
    #1

    i want to use ajax in content page i have script manager on master page in content page i have following code <asp:Content ID="Content2" ContentPlaceHolderID="MainContents" runat="server" EnableViewState="true"> <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server"> </asp:ScriptManagerProxy> <asp:CheckBox ID="CheckBox1" runat="server" OnCheckedChanged ="checkchange" AutoPostBack ="true"/> <asp:UpdatePanel ID="updatePnl" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:TextBox ID="TextBox1" runat="server" visible="false" ></asp:TextBox> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="CheckBox1" /> </Triggers> </asp:UpdatePanel> </asp:Content> on server side i have following protected void checkchange(object sender, EventArgs e) { if (CheckBox1.Checked) { TextBox1.Visible = true; Label1.Text = Label1.Text + "HEllo"; } else { TextBox1.Visible = false; Label1.Text = Label1.Text + "bye"; } } problem is checkchange call just once if i click towice on check box it does not works

    J 1 Reply Last reply
    0
    • 2 2208

      i want to use ajax in content page i have script manager on master page in content page i have following code <asp:Content ID="Content2" ContentPlaceHolderID="MainContents" runat="server" EnableViewState="true"> <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server"> </asp:ScriptManagerProxy> <asp:CheckBox ID="CheckBox1" runat="server" OnCheckedChanged ="checkchange" AutoPostBack ="true"/> <asp:UpdatePanel ID="updatePnl" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:TextBox ID="TextBox1" runat="server" visible="false" ></asp:TextBox> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="CheckBox1" /> </Triggers> </asp:UpdatePanel> </asp:Content> on server side i have following protected void checkchange(object sender, EventArgs e) { if (CheckBox1.Checked) { TextBox1.Visible = true; Label1.Text = Label1.Text + "HEllo"; } else { TextBox1.Visible = false; Label1.Text = Label1.Text + "bye"; } } problem is checkchange call just once if i click towice on check box it does not works

      J Offline
      J Offline
      Jeroenh
      wrote on last edited by
      #2

      Put the checkbox inside the updatepanel

      2 1 Reply Last reply
      0
      • J Jeroenh

        Put the checkbox inside the updatepanel

        2 Offline
        2 Offline
        2208
        wrote on last edited by
        #3

        i have try this but same problem and error is Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET4.0C; .NET4.0E) Timestamp: Mon, 26 Jul 2010 10:19:37 UTC Message: Unknown runtime error Line: 345 Char: 9 Code: 0 URI: http://localhost:4099/ScriptResource.axd?d=9I1lWtAvVqWN1mD9glifsmEaMOiOLiTKjnBQwe4NQFLjuZpRoCN\_LRiI-oQlHO1ffCWMttDUGTSGUEn\_n-0ZNQXbP7japojTJ\_LVrzCwdLJYzGHv0-QESNieL9JuFlAo0&t=ffffffffec2d9970 Message: '__EVENTTARGET' is null or not an object Line: 482 Char: 9 Code: 0 URI: http://localhost:4099/ScriptResource.axd?d=9I1lWtAvVqWN1mD9glifsmEaMOiOLiTKjnBQwe4NQFLjuZpRoCN\_LRiI-oQlHO1ffCWMttDUGTSGUEn\_n-0ZNQXbP7japojTJ\_LVrzCwdLJYzGHv0-QESNieL9JuFlAo0&t=ffffffffec2d9970 Message: '__EVENTTARGET' is null or not an object Line: 482 Char: 9 Code: 0 URI: http://localhost:4099/ScriptResource.axd?d=9I1lWtAvVqWN1mD9glifsmEaMOiOLiTKjnBQwe4NQFLjuZpRoCN\_LRiI-oQlHO1ffCWMttDUGTSGUEn\_n-0ZNQXbP7japojTJ\_LVrzCwdLJYzGHv0-QESNieL9JuFlAo0&t=ffffffffec2d9970 Message: '__EVENTTARGET' is null or not an object Line: 482 Char: 9 Code: 0 URI: http://localhost:4099/ScriptResource.axd?d=9I1lWtAvVqWN1mD9glifsmEaMOiOLiTKjnBQwe4NQFLjuZpRoCN\_LRiI-oQlHO1ffCWMttDUGTSGUEn\_n-0ZNQXbP7japojTJ\_LVrzCwdLJYzGHv0-QESNieL9JuFlAo0&t=ffffffffec2d9970 Message: '__EVENTTARGET' is null or not an object Line: 482 Char: 9 Code: 0 URI: http://localhost:4099/ScriptResource.axd?d=9I1lWtAvVqWN1mD9glifsmEaMOiOLiTKjnBQwe4NQFLjuZpRoCN\_LRiI-oQlHO1ffCWMttDUGTSGUEn\_n-0ZNQXbP7japojTJ\_LVrzCwdLJYzGHv0-QESNieL9JuFlAo0&t=ffffffffec2d9970 Message: '__EVENTTARGET' is null or not an object Line: 482 Char: 9 Code: 0 URI: http://localhost:4099/ScriptResource.axd?d=9I1lWtAvVqWN1mD9glifsmEaMOiOLiTKjnBQwe4NQFLjuZpRoCN\_LRiI-oQlHO1ffCWMttDUGTSGUEn\_n-0ZNQXbP7japojTJ\_LVrzCwdLJYzGHv0-QESNieL9JuFlAo0&t=ffffffffec2d9970 Message: '__EVENTTARGET' is null or not an object Line: 482 Char: 9 Code: 0 URI: http://localhost:4099/ScriptResource.axd?d=9I1lWtAvVqWN1mD9glifsmEaMOiOLiTKjnBQwe4NQFLjuZpRoCN\_LRiI-oQlHO1ffCWMttDUGTSGUEn\_n-0ZNQXbP7japojTJ\_LVrzCwdLJYzGHv0-QESNieL9JuFlAo0&t=ffffffffec2d9970 how i can solve this

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups