Modify Web Control in Function by Passing in Web Control's ID as Parameter

Good day to all,

I am trying to modify web controls through functions by passing in their ID as the parameter so that I can call the function whether a control's properties need to be modify.
The rough idea I have is as follows:
(Function, In VB)
Function ModifyTextboxText(Byval SampleTextbox)
SampleTextBox.text = "Textbox contents changed."
End function
(Calling the function)
ModifyTextboxText(MyTextbox.id)
Has anyone got any idea how I could proceed with the coding?
Appreciate any help around here. Its for my school project.
Thanks!
0
debido
3/8/2005 3:31:41 AM
asp.net.web-forms 93655 articles. 5 followers. Follow

0 Replies
703 Views

Similar Articles

[PageSpeed] 40

Reply:

Similar Artilces:

Web control in web control
Hi,There are two simple web user controls A and B, where B contains A. They just display the bunch of text boxes, so I do not need them even in tool pane. They sit in the same project next to web form.I noticed that web user control put on ASPX page does not appear in code behind, but if I create it with protected keyword and name being exactly the same as id it works fine. I can access such a web control from code behind and see the value assigned in IE. The problem is that the same routine does work for my A web control in B. When I assign the value IE, I keep getting null reference. ...

Controlling web control instances on Web Form
I have created a composite control, extending functionality of the Hidden Control. However, I would like to prevent the user from adding this control to the page multiple times. I only want one instance of the control on the Web Form. What setting in my project to I adjust to enable this functionality? I can not find it in any of the books that I have referenced. Is this a setting or is this code that has to be added to the inheriting class. Looks like there is no standard apporach. But I'd consider using static field to count number of created objects and throw exception if second object ...

Access Web Control's property within the Web Form
Hello, I have a Web Control which has a TextBox and a Button. I want to put this Control on a WebForm, then put some text in a Control's TextBox, press on Control's Button and be able to access text box's value from within the Web Form. That's my Control: _________________________________________________ public class Colo : System.Web.UI.UserControl { protected System.Web.UI.WebControls.TextBox TextBox1; protected System.Web.UI.WebControls.Button Button1; public string Myval{ get{return (string)ViewState["myval"];} set{ViewState["myval"] = va...

Passing values from a parent web control to child web control
I have a parent control which called CONTROL1 and a child control witch called CONTROL2 I would link to pass a value from the parent control to the child control. In the parent control(CONTROL1) I have the following Event Handler . private void btn_Handler(object sender, EventArgs e) { …      if (Page.IsPostBack) {              // Send the officer names to the child controls.             if(m_nameList.SelectedItem.Text != "")     ...

web web web
Name: bahadir Email: sensiz_olmuyor_t1_at_hotmail.com Product: Firefox 2 Beta 2 Summary: web web web Comments: web sayfası yapmak Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; tr; rv:1.8.1b2) Gecko/20060821 Firefox/2.0b2 ...

web controls and web user control
i have a problem in a web form , I have a webform that contains a web user control which in turn contains a html input form ,the web control events don't fire up ,When I click button ,no effect ,I don't know what is the effect of the html form which is in the web user control on the web controls in the web form ?? can any one help me the web control event should be handle in the code behind page, is the event handler for the button you are clicking registered? You can try double clicking the button, should give you the default btn_click event handler in code behind. Also, make ...

Use Web Control In a Web Control
Is this possible?I am working with an aspx page that consists of many different web controls.One of the web controls contains search criteria.  One of the criteria is a date range where I am trying to add a popup calendar --> which is another web controlCan I register the popupcaledar control on the questionaire control?  I have tried, but nothing seems to be registered.Any ideas will GREATLY help.Relax and have some Home Brew!Prosecute the Owner - Don't PERSECUTE the Breed!Breed Specific Legislation targets the WRONG end of the LEASH! Without seeing your code we can'...

controlling an object in a web control from the page the web control is placed in
I have created a web control in vb.net that has an image button and an image. when it loads the image button is visible and the image is not. I want to be able from the page which "includes" the web control to set the image button to invisible and the image to visible. When I tried this, the main page didn't recognise the image button or the image (both < asp: objects). help would be gratefully appreciated. oh yeah, it's inline code so any code behind stuff will just confuse me ;) Some code please.-- Justin Lovell...

Pass data from Web User Control to Web Form
I have a Web Form that contains a Web User Control. The WUC displays dynamic content. I want to change the TITLE property of the Web Form, based on the contents of the WUC. For example, if the WUC displays information about Horses, I want to change the page title to "HORSES" by passing the string to the parent Web Form. I have tried playing with parameters and such, but I can't remember how I did this in the past. PLEASE HELP!~o0 Spin-Monkey Oo~ The best way to do this is by creating a public property on your web user control and accessing that from your web form. Check ...

Where are my web controls? Uh-oh, where's my web page?
What shall I do? I've taken an html page, provided by another person, and replaced the html controls with asp webcontrols. I've adjusted the pages meta data and headers to reflect the vb codebehind. All asp web controls are also contained in a form with runat="server". Here's the kicker. When I look at the form in design view, it's all there, however, when I run it from my browser--no web controls :( I found a forum user that successfully fixed this problem by running aspnet_regiis.exe -i from WINNT\Microsoft.NET\Framework\v1.0.3705. I did the same and now when I attempt t...

Problem in web service's web method's parameters.
Hello All,I am tring to consume a Java web service in ASP.NET(c#) application.In the web service, the web method 'checklogin' accepts 2 string parameters only, with return type a boolean variable. But, when I use that method in my ASP.NET application it shows me 4 parameters in the definition namely 2 string parameters(which should be there) and extra 2  boolean type OUT parameters. Out of these 2 extra OUT parameters, in the 1st parameter I get the return variable of the web method which I called/used and in the 2nd parameter, its showing nothing (means its showing default...

Mobile Web Controls vs. Web Controls
I am using VS2003 and I have realized that Mobile Web Controls are very basic and simple. So I saw in a post the way to use Web Controls inside Mobile Web Forms. Since then, I often use Web Controls instead of Mobile Web Controls. I put the Web Control inside a Mobile DeviceSpecific and put this DeviceSpecific inside a Mobile Panel. Why the Mobile Controls are so simple?  Does it happen the same in VS2005 or 2008? And, is it right to use only Web Controls inside Mobile Web Forms? Thanks. xesteban:Why the Mobile Controls are so simple?   They are simple because they suppor...

How to access a control on a web form from anoter web form
hi all I have this scenarios i have two web forms, one called form1 and the other called form2 form1 has a label with id "lbl1" is it possible to access lbl1 from form2, change its text permenantly? thanks.   refer: http://dotnetslackers.com/Community/blogs/haissam/archive/2007/11/26/ways-to-pass-data-between-webforms.aspxSSNPlease remember to click "Mark as Answer" on the post that helps you. MinaSamy: hi all I have this scenarios i have two web forms, one called form1 and the other called form2 form1 has a label with id "lbl1" is it p...

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 resources about - Modify Web Control in Function by Passing in Web Control's ID as Parameter - asp.net.web-forms

Resources last updated: 11/27/2015 9:13:07 AM