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 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...
Pass values from one user control to a user control on a different aspx page
Hello,
I have an aspx page titled Search.aspx. Within this page, I have a user control titled Search.ascx. I want a user to input search terms, then on the click of a button, I want to pass the values to another page (SearchResults.aspx)....which will then display the results in a user control.
Can someone please give me some suggestions on how to do this?
Thanks a lot!
Hello, what you can do is:
inside ur usercontrol, create a method that returns a dataset or datareader. that is, since u are searching using the usercontrol, then the result of ur search will be return...
How to pass control values from one ascx user-control to another???
Our site is set up using a primary default aspx page that is used as the "base page" for everything. On this page, we dynmaically place various user controls at run-time. This gives us a functionality similar to using frames where the outer-frame actually just sits there while various webfiles are loaded inside of it.
Works great except for one thing...
trying to figure out the best way to pass control names/values accross user controls.
When the same usercontrol is posting back to itself this is a non issue. So far most of our functionality has worked well using the local...
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!
Hi,You need to re-bind the GridView with the updated data source so that it reflects the latest changes. Regarding the cur...
User Control Passing Data To Another User Control?
I got two user controls in a .aspx page. one user control contains a list of names along with the user id as that listbox .value property. now when the user selects a user a clicks on a command button it needs to send the value of the selected user name to another user control in the same form name shippingInfo; Anyone know how to do this; I keep getting a "Object reference not set to an instance of an object" error message here is the code for the MyContacts control (the one with the user name and user id value)
Imports PackageDeliveryVB.ShippingRequestInfo
Public Class...
Gettin values from one user control in other user control
Hello,I have a web page in which I have to user controls UC1 and UC2.In UC1 there are few text boxes (eg: txtContactNumber etc...)In
UC2 I have a button. On the click of the button I want to get the value
entered in the txtContactNumber textbox which is in UC1 user control.How to do this. Please let me know.Any code for the example if given is appreciated.Thank You.
In the codebehind for UC1 put the following:public string ContactNumber
{
get { return txtContactNumber.Text; }
set { txtContactNumber.Text = value; }
} And in UC2:private string ...
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...
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 ...
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...
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 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...