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
  1. Home
  2. Web Development
  3. ASP.NET
  4. User Control Load Problem

User Control Load Problem

Scheduled Pinned Locked Moved ASP.NET
help
5 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.
  • A Offline
    A Offline
    Abhi
    wrote on last edited by
    #1

    Hi.. Friends !! I want to refresh my user control after clicking on button... Means, I have a shopping cart page, and when I click on 'Add to Cart' button from GridView, I want to reload my 'CartListing' user control on the same page... Because, When I click on 'add to cart' button, It simply postback the current page, And I can not see the last added product in cart listing user control !! So, I have to dynamically refresh my 'CartListing' user control... And I dont know to to refresh it after clickin on button... So, If you have any idea regarding it, please given me ASAP Thanks in advance !! Bye.. Take care.

    Regards, Abhi

    N 1 Reply Last reply
    0
    • A Abhi

      Hi.. Friends !! I want to refresh my user control after clicking on button... Means, I have a shopping cart page, and when I click on 'Add to Cart' button from GridView, I want to reload my 'CartListing' user control on the same page... Because, When I click on 'add to cart' button, It simply postback the current page, And I can not see the last added product in cart listing user control !! So, I have to dynamically refresh my 'CartListing' user control... And I dont know to to refresh it after clickin on button... So, If you have any idea regarding it, please given me ASAP Thanks in advance !! Bye.. Take care.

      Regards, Abhi

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      -- Abhi -- wrote:

      Because, When I click on 'add to cart' button, It simply postback the current page, And I can not see the last added product in cart listing user control !!

      This won't be a problem of user control reloading. Web user controls ( ascx files ) are replacement for classical ASP include files. When page posts back, your user control also reloads. If it is not showing the newly added items, that may be some other reason. How you are maintaining the cart ? Is your user control having any cache option set ?


      My Website | Ask smart questions

      A 1 Reply Last reply
      0
      • N N a v a n e e t h

        -- Abhi -- wrote:

        Because, When I click on 'add to cart' button, It simply postback the current page, And I can not see the last added product in cart listing user control !!

        This won't be a problem of user control reloading. Web user controls ( ascx files ) are replacement for classical ASP include files. When page posts back, your user control also reloads. If it is not showing the newly added items, that may be some other reason. How you are maintaining the cart ? Is your user control having any cache option set ?


        My Website | Ask smart questions

        A Offline
        A Offline
        Abhi
        wrote on last edited by
        #3

        Thanks so much from your reply post... But, the thing is that.. I got solution by other way... Thanks a lot !! Take care.. Bye.

        Regards, Abhi

        N 1 Reply Last reply
        0
        • A Abhi

          Thanks so much from your reply post... But, the thing is that.. I got solution by other way... Thanks a lot !! Take care.. Bye.

          Regards, Abhi

          N Offline
          N Offline
          N a v a n e e t h
          wrote on last edited by
          #4

          -- Abhi -- wrote:

          I got solution by other way...

          That's great. Would you mind sharing it here ?


          My Website | Ask smart questions

          A 1 Reply Last reply
          0
          • N N a v a n e e t h

            -- Abhi -- wrote:

            I got solution by other way...

            That's great. Would you mind sharing it here ?


            My Website | Ask smart questions

            A Offline
            A Offline
            Abhi
            wrote on last edited by
            #5

            Yes. Sure. See, I have a 'CartList' user control. Now, this 'CartList' control contais a 'private void BindCart()' methods that binds the current product items to the grid view those are purchased by client. Now, In my 'ProductListing.aspx' I have to refresh this User Control my 'Add to Cart' button click. Now, What i have done is : 1. I have made 'private void BindCart()' methods to 'public void BindCart()'. So, I have made public methods in my UserControl. 2. I have first of all inserted all product to the 'tblCart' those are purchased by client. 3. Then, I called this Methods on 'Add to Cart' button click event. Ex. ProductCart1.BindGrid(); 4. So, Now I've a refreshed product cart on my same page. That's it. Thanks for this conversation.

            Regards, Abhi

            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