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. Masterpage control update

Masterpage control update

Scheduled Pinned Locked Moved ASP.NET
databasequestionwpfhelptutorial
3 Posts 3 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.
  • R Offline
    R Offline
    Ridge Howison
    wrote on last edited by
    #1

    Hello, Thank you for reading. Here is my situation. I have a masterpage with a tablerow that has a few webuser controls inside of <td>. one of my content page is a gridview with item templates,on clicking on a row it shows up a AJAX modalpopup with a button and on click and increments count by 1 in a database table. The webuser control mentioned above gets the count from the db and displays the count. For example when the user first comes in for example, lets say the webusercontrol A shows -Hello XYZ, you have 2 items in your shopping cart. Then the user goes to my page with the gridview and clicks on an item and says add to cart. This would increment in the db the count to 3. I want the webuser control in my masterpage to get this value immediately and display -You have 3 items in your shopping cart. How can I achieve this with updatepanels and how do i trigger a postback for the webusercontrol in my masterpage?   All help is greatly appreciated, if you have any code samples or links that do something similar that would be wonderful !! Thanks RH

    A D 2 Replies Last reply
    0
    • R Ridge Howison

      Hello, Thank you for reading. Here is my situation. I have a masterpage with a tablerow that has a few webuser controls inside of <td>. one of my content page is a gridview with item templates,on clicking on a row it shows up a AJAX modalpopup with a button and on click and increments count by 1 in a database table. The webuser control mentioned above gets the count from the db and displays the count. For example when the user first comes in for example, lets say the webusercontrol A shows -Hello XYZ, you have 2 items in your shopping cart. Then the user goes to my page with the gridview and clicks on an item and says add to cart. This would increment in the db the count to 3. I want the webuser control in my masterpage to get this value immediately and display -You have 3 items in your shopping cart. How can I achieve this with updatepanels and how do i trigger a postback for the webusercontrol in my masterpage?   All help is greatly appreciated, if you have any code samples or links that do something similar that would be wonderful !! Thanks RH

      A Offline
      A Offline
      Abhishek Sur
      wrote on last edited by
      #2

      Well, Actually if you write the code to fetch data from the database and restore to a label... in the Page_load section of the Masterpage, the job will be quickly done... Just get the value from database each time and place the message on the screen. :):thumbsup:

      Abhishek Sur


      My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

      **Don't forget to click "Good Answer" if you like to.

      1 Reply Last reply
      0
      • R Ridge Howison

        Hello, Thank you for reading. Here is my situation. I have a masterpage with a tablerow that has a few webuser controls inside of <td>. one of my content page is a gridview with item templates,on clicking on a row it shows up a AJAX modalpopup with a button and on click and increments count by 1 in a database table. The webuser control mentioned above gets the count from the db and displays the count. For example when the user first comes in for example, lets say the webusercontrol A shows -Hello XYZ, you have 2 items in your shopping cart. Then the user goes to my page with the gridview and clicks on an item and says add to cart. This would increment in the db the count to 3. I want the webuser control in my masterpage to get this value immediately and display -You have 3 items in your shopping cart. How can I achieve this with updatepanels and how do i trigger a postback for the webusercontrol in my masterpage?   All help is greatly appreciated, if you have any code samples or links that do something similar that would be wonderful !! Thanks RH

        D Offline
        D Offline
        droth17
        wrote on last edited by
        #3

        After you capture the event from the Modal window have a public Sub in your user control that you can call that updates the UC. You can either pass the values into the usercontrol or requery the DB, I would just pass the values in if you already know them. It would be something like this in the content page, then the corresponding sub in the User Control

        Dim oUC As MyUserControlType = CType(Master.FindControl("UserControlName"), MyUserControlType)

        oUC.UpdateMe(NewValue)

        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