I have a user object and each user.. has a parent! Of course one user must be the exception, can't be a rule without exceptions.
What to do with the user that has no 'parent'?
1. Create a constant/global SystemUser whose parent is NULL
2. Allow any User's parent to be NULL and hope that only 1 user ever will have a NULL parent
3. Allow a User to be their own parent implying they are the top of the food chain
Really not sure what the best strategy is here, the users will be stored in a table along with their parent user's ID. Each user has one and only one immediate parent.
i am making an application which is like chain system..i mean one person can have multiple child.. then his child can have multiple child ..etc like chain system...i dont know to insert into database.. so that when i call any-node.. his child,, and their futher child will show...
I have this weird problem. I have an aspx page which contains a User Control(Parent). This Parent User Control contains another User Control(Child). Now, when i run my website it works ok until I have make some event inside the child control, at this moment the parent control stop responding!!!. The child user control appears and loads data correctly but when I try to do something inside it, the parent user control stop working correctly.
I'm having trouble to access a Parent's property in User Control. I don't know how to access the parent. The Parent Page's name is Search.aspx. I saw the example below and tried it:
[Code]....
Than I could access the Parent's Property, but when I ran the website I got these errors:
1. The user control is not declared in the parent page 2. The user contol has a circular reference
I have a hidden field on my default.aspx page. Within default.aspx page I have a user control which has a label on it. I need the label to display the value on the hidden field. How can I go about this?
I am using a user control that I created (just a .cs file not an .ascx file), that does some magic and depending on a value generated by the control, I need it to do something on the parent page that is 'hosting' the control. It needs to call a method under certain circumstances (method is on the parent control).the control is placed on the parent page like so:
I'm dynamically creating buttons etc on the control itself but when a button is clicked, let's say for example that there's a text box on the control and if the value of the textbox is "bob" it needs to call a method on the page that's housing the control...how can I accomplish this?
I have a user control which contains two text fields each assigned with requiredfield validators this control contains another user control contains say a button .On click of this button i need to validate the fields from the parent control text fields.I try the Page.Validate("ValidationGroup") with Page.IsValid it validates but the error message is not shown .Error message is shown only if i try to validate it from the contains which contains the required field validators ?
Basically, I have a user control with a set of input controls such as textboxes and radio buttons. It also has a button along with these controls. What I want is that when the user clicks this particular button, the data entered in the input fields must get updated into a grid in the parent page.
I'm trying to get my treeview control to work where a user clicks on a parent node. The node will expand.Then, the user clicks on another parent node and that node expands while the previous parent node stays expanded. My problem is that when I expand one parent node, another expanded parent node collapses.What am I doing wrong?
I have a class UserControlBase that inherits System.Web.UI.UserControl and my user controls inherit UserControlBase class. UserControlBase has some common functions that are used in all user controls.
I want to put error display funtion to UserControlBase as well so that I may not have to declare and manage it in all user controls. Error will be displayed in some label in usercontrol. Issue is how to access label which is in usercontrol in UserControlBase in function ?
I have a login control and at is nested 2 deep in a header control i.e Page --> Header Control --> Login Control. I cannot get a reference to the control on the page using FindControl. I want to be able to set the visible property of the control like
[code]....
I ended up using a recursive FindControl method to find the nested control.
but it is throwing as exception Object reference not set to an instance of an object.How can I access user control's gridview control from parent page?
protected void Page_Load(object sender, EventArgs e) { LoadMyControl(Parameters); //Do it every page load to preserve it's state } protected void LoadMyControl(string parameters) { plchld.Controls.Clear(); Control userControl = LoadControl("TheUserControl.ascx"); userControl.ID = "userControl1"; plchld.Controls.Add(userControl); }
Now inside this control, when a button is clicked I want to update ,let's say a Label on the hosting page. What is the best way to do it? Custom event?
how to call a function of user control from the parent page?
I have a user control inside of default.aspx page, And I have a function in the code behind of user control. I need to call that function from a code behind of default.aspx
I looked up the threads about this. But I couldn't do it...
this is my method in aspx.page:
public void MesajlariGetir() { DataSet ds = new DataSet(); SqlConnection con = new SqlConnection(); SqlCommand cmd = new SqlCommand("msjlarigetir", con);
i want to pass the value of variable form popup page to main page. i have try to use the session but i can't because the main page is start before the popup page start.
Is it possible to do this? Or do I need to make a server control for this functionality? I have it being able to be set in the Page_Init, but I'd like to make it as similar to actual controls as possible. Also, if it is possible to access via the Events section under Properties, that would be good and 2. I am trying to register the web user control as an AsyncPostbackTrigger for another UpdatePanel. With the previous question in mind, is it also possible to set this via the GUI, or does this need to be set programmatically as well?
I have a LinkButton within a User Control and it has handled with:
Private Sub LoginLinkLinkButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LoginLinkLinkButton.Click Response.Redirect("/", True) End Sub
On certain ASPX pages I would like to handle the click from the page's code behind, opposed to within the user control. How do I override the handle within the control from the parent's code behind page?
Update:
Based on the answer, I have the following no added to the User Control:
[code]....
The problem is determining the correct syntax for the if line because the above is invalid.
I have an EDIT.ASPX page and on that page I have some labels and textboxes and a user control. I listed all the related codes you can have a clear picture - not all of the codes are given me a problem. ONLY ONE.
HELP ---> On the Uer control (SiteTemplate2.ascx) I have a DataList that is being populated by the database and that works fine. I have a CHECKBOX on the user control page each time the user check the CHECKBOX the user control content totally disappears from the EDIT.ASPX page. There is no error message -- I believe this is a post back error but I don't know how to fix it.
Goal: Each time the checkbox called (CHKBSideBar) is clicked on the user control page all of the page content should stay in place that include
EDIT.ASPX Page and the refeneced USER CONTROL. I should be implement a CheckedChanged Function without either of the pages lossing DATA. I need to be able to access post back event from the user control of the Edit.aspx page. When the user click a box on the user control page how do I keep the same Page_Load event on the edit page. I need to reference the Edit page from the user control.
Note: The edit page loads the user control (SiteTemplate2.ascx)SEE CODES BELOW
I know this is a lot and thank you in advanced for your help. I tried to include all the pages that are key players. I must user the user control bacuase the user can select different template so eliminating the user control is not an option.
i would like to ask about how can i open user control page when i click a button on parent page, also, can i call parent's method from user control page and then refresh parent page?
I'm building a site that can possibly have millions of users (yes ambitious!). Each user can upload an image or two for his/her profile. How would you architect the directories to support this type of thing? I was thinking of having a users subfolder off the root dir where each user will have their own sub-dir that corresponds to their userId created at registration time. I could then upload their profile pics to their corresponding sub-directory under the users dir. Seems straightforward but am I missing anything? Can I have a million sub-dirs under the user dir? NTFS supports it so my guess is YES.
I'm developing web application with concurrent user using the application. The problem i'm facing is that if the first user login his details are taken affecting the second user how is process the data in the application.How to avoid it?the best way to code to maintain concurrent users.
I am working on a web application project with a layered architectural style having DAL, BLL, Service Layer and Presentation Layer. It's going to be a Web forms application.
My intent is to try using some of the new features of .Net 3.5 or 4.0.
Currently, I am thinking through different approaches for implementing Authentication in this project.
I have a query regarding the design of the application, particularly Authentication.
In which layer should I have Authentication class? BLL? If I implement the Authentication class in BLL, should I be having an app.config in the same class library project to contain the Database connection string and all.