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