Update one user control from another user control

I have two user controls (.ascx files) on one .aspx page. They are in some kind of master-detail relationship. When I select a row in the GridView in first control, second control is populated with editable data. After changing data and clicking update data IS saved but GridView in first control is not updated.

How can I cause that data in first control refreshes, but to keep selected row selected?

__
Please mark post as answer if it helps, if not come back and ask again!
0
millet
8/28/2006 11:15:58 AM
asp.net.web-forms 93655 articles. 6 followers. Follow

1 Replies
956 Views

Similar Articles

[PageSpeed] 6

Hi,

You need to re-bind the GridView with the updated data source so that it reflects the latest changes. Regarding the currently selected value (row), it would be lost as data would be rebinded, but you can use Session (or similar) to hold that row ID and mark it selected again.

Hope this helps,

Vivek


Social Networking Platform in ASP.NET || Join now: CodeASP.NET Community

Please mark the most helpful reply/replies as "Answer".
0
vivek_iit
8/28/2006 12:14:22 PM
Reply:

Similar Artilces:

Updating a Label control in one user control from another user control
Hi all, I have a main page in my music store site that has 5 user controls on it with 1 always showing main content and the others being things like a shopping cart, "best sellers", genre list etc (a la amazon). From the main content control I want to be able to set some label controls in my shopping basket control but I just can't seem to work out the syntax for how to do this: Here's the code I'm using - I'm trying to go to the 4th user control on the page (my shopping basket) then find the appropraite label, cast it locally as a Label then update the value: Label _so...

Web user control inside update panel replace with another web user control
 Hi there. I have a page with a menu. an and then the content. My thing is. That i have the update panel, and inside that i have a regual panel in which i add the Web User Controls i need. Which all works fine. My problem is. That i i have a submit funcion on almoast all the Web User controls. What i would like is that i inside that update panel, can dispose the original Web user Control and then add a response Web User Control. In normal language. Is there a way that i can load one web user control into antoher and then disposose the original? Thanks in advance hello. well, what ...

want to call one c#.net function in one user control from another user control
hi i have two user controls info.ascx and personal.ascx i have a function like in info.ascx i have a function like showdetails() {   } now i want to access this function from personal.ascx can i do this ? thanks in advance. shwetaThanksshwetaIn a day when don't come across any problem -you can be sure that you are traveling in wrong path  you should better create a class where you will define the "functions" that you need in both files. declare "static" the function and call it like nameofclass.nameoffunction In a web project you can...

I have a web user control being used by another web user control, but the one being used will not display the labels in the resx file.
I am using DotNetNuke version 3.13 (might be 3.013) on a Window's XP machine, SP2. I have what I find to be an extremely odd situation. I have a project called TDS.Controls. This project is a web control library. Each control has its own resx file, which is located in the App_LocalResources directory. Each control inherits from Framework.UserControlBase, just like DotNetNuke's User control in DNN\Controls\User.ascx.vb. As a matter of fact, this control is doing the exact same thing I am trying to do. It is a web user control with its own resx file being used by another web user control (See ...

Updating a User Control from another User control
I have a web page that has three frames: Header, Nav, and Content. In the header frame, I have a user control for the breadcrumb text (something like "Home : Cases : Jones Case : Contacts") that needs to be updated based on information sent from another user control which is in the Content frame. Is this possible?...

Web User Control to Web User Control...
Hi, I have 2 User controls on a page and want Control1 to call a method of Control2. Is this Possible? Example: Con1 = Datalist showing products, each with a Quantity Box and a Button. Con2 = Repeater showing Cart Preview (name, Price) in page.aspx. When I click on the button on the DataList in Con1 it adds the item into the Session based Cart. However it does not update the Cart Preview. I need to call BindPreview() in Con2 in order to update the Cart Preview... Does that make sense? argh! any help much appreciated! PeteWeb Design Nottingham, UK Well I can call BindPreview() from m...

access controls on web user control x from web user control Y
I have 2 web users controls in a page and I would like to get or set the selected values of a few dropdown boxes on web user control X from web user control Y and I also would like to know how to access functions that are on a web user control X from a web user control Y, is this possible? How can I do it? User can access and set the values of the User Control from .aspx page through properties,using javascript and in code-behind of aspx page.The details of it are shown below Using PropertiesIf the Sample.ascx control has two textboxes and submit button.You can access the valu...

Pass value from one User Control to another User Control
I have tried to pass value from one user control to another user control. Because of Page Auto Postback, Contrls are load before page is loaded. So I get the value in 2nd UC after one more post back operation. I have visited many suggessions but I cant solve this. Is anyone can help me to solve this. Thank U mfhossain@gmail.com Muhmmad Fakhrul HossainEmail: mfhossain@gmail.comPhone: +88 01715 111512Web: http://www.mfhossain.info You'd have to do that through the parent probably in it's Page_Load event handler.   userControl1.publicProperty = userControl2.publicProperty;  ...

How to access one user control from another user control on same page
hi,I have two usercontrol on same page. 1.ascx and 2.ascx on abc.aspx . Now I need to access dropdown on 1.ascx frm 2.ascx . Plz help me how can i do this?I have tried Page.findcontrol but as a user control inherits usercontrol class and not page class . its not giving reference to proeprty Page.Findcontrol. I can do page.findcontrol on aspx page but I need to do it on ascx only.plz helpregards,max   Hi Max, you have to expose your DropDownList as a public property which lays inside usercontrol 1. Example: 1 class MyUserControl1 : UserControl 2 { 3 4 p...

How to bind grid of one user control from another user control
i am having a data grid in one user control say A and there is another user control say B when ever i add some vale in B that is inserted in to database and i want to call A's bind method of grid ... Please help me Nilesh Garg Well, If you can get a hold on Page control of user control then you can easily deal with the othe ruser control. Try something like this Me.Parent or Me.Page or somethinglike this to take hold on Page control and then you can easilly get instance of othe ruser control. Alternatively you can have one shared method somewhere in some class. Call it and i...

How to call a function from one User Control from another User Control
Hi, I have one User Control in a page, the User Control has a button, when the user clicks on the button, I need to call a function within another User Control (on the same page).  I have made a function public, but I don't know see the function from the other User Control. Can you help me please, Thank you! Aldo have u added a delegate event for the button clicked like in the example below. ////////WebUserControl1 public partial class WebUserControl1 : System.Web.UI.UserControl {public delegate void ButtonClciked(object sender, EventArgs e); public event B...

How to access a user control from another user control in a Wizard control
My page has a wizard control and each step is a user control.  I could find the value of a control in step1 user control in the wizard page but not in step2 user control.From wizard.aspx.vb – it worksDim m_title As DropDownList = CType(Me.PersonalBox1.FindControl("ddlTitle1"), DropDownList) Question:How can I find the value of a control(textbox or dropdownlist)in step1 user control from step2 user control? I want to find “PersonalBox1.FindControl("ddlTitle1")” from Step2 AddressBox1. I have tried several ways to access it but no luck. From AddressBox.ascx.vb –...

How can I update a control in one user control from another?
Hi all, I have a page made up of numeruos user controls. In the first one (header.ascx) I have a literal control called "litPageTitle". However depending on what the user does in one of the other user controls (registration.ascx) I want to change the text in the page title literal. eg://This code is in the second user control on the page (registration.ascx) if (currentAction == "1") ChangePageTitle("Terms and Conditions"); else if (currentAction == "2") ChangePageTitle("Contact Details"); else if (current...

Problem sharing a webcontrol in one User Control with another User Control...
Hi,I need to "share" a button in one User Control with another User Control. I have been trying to make it work for a long time, but I am nearly giving up. Please help! (I am coding in ASP.NET 2.0 C#)I have a main page (default.aspx) that contains two User Controls (mainUC.ascx & buttonUC.ascx).At first the User Control mainUC contains text (textHolder) that is clickable and the User Control buttonUC contains a button (editButton) that is disabled.The functionality I need is:1. When I click the text (textHolder in mainUC) the button (editButton in buttonUC) is enabled. This wor...

Web resources about - Update one user control from another user control - asp.net.web-forms

Control - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Church is about power, money and control
Readers react angrily, and sceptically, to the news that Cardinal George Pell may not be able to return to Australia to attend the royal commission ...

Microsoft Band updated to include music controls and inactivity alerts
... Microsoft Band came out, the company is adding functionality with a small software update. The two biggest features of this update—music controls ...

Control a car's features with a glance? Not science fiction
Filed under: Emerging Technologies , Infotainment , Technology Press a button to change your car's climate controls? Turn a knob to view your ...

"... Trump owns and controls the media... they can't not cover him... his audience is bigger than theirs ...
... their army (i.e., the media) can't take out their enemy. They don't have the slightest idea what to do.... The media, in their own minds, controls ...

How to control your iPhone by just tilting your head
... the best sight, hearing, or motor functions to still use iOS to its fullest capabilities — but they can also be used to customize your controls. ...

Jennifer Hudson On Gun Control: ‘We Are Acting Like Animals. We Need It’
Jennifer Hudson On Gun Control: ‘We Are Acting Like Animals.

Bart & Fleming: Don’t Come To Year-End Movies To Get Laid; Time For Movies About Gun Control Debate?
Peter Bart and Mike Fleming Jr. worked together for two decades at Daily Variety . In this weekly Sunday column, two old friends get together ...

The NFL Should Seize Control Of The Cleveland Browns
Drew Magary’s Thursday Afternoon NFL Dick Joke Jamboroo runs every Thursday during the NFL season. Email Drew here . Read more...

Republique finally gets analog controls on PS4
... transitions (like Resident Evil ) which is mildly disorienting at first but could actually be easier to wrap your head around with a controllable ...

Resources last updated: 12/14/2015 7:50:01 AM