473,413 Members | 1,737 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

Using a web control from a different page

If anyone could assist me with this issue, I'd really appreciate it!

I have a literal web control, litControl1, in webForm.aspx.
I want to modify the litControl text property from a user control
code-behind page, userControl.ascx.vb.

To do this with VS2003, I had to modify the Web Form Designer Generated
code
from
Protected WithEvents litControl1 As System.Web.UI.WebControls.Literal
to
Public Shared litControl1 As System.Web.UI.WebControls.Literal

and then I could access the property using webForm.litControl1.text =
"whatever"

Since upgrading to VS2005, this code is no longer valid.

Does anyone have any thoughts on any other methods to try???

Thanx in advance!!!
-Dina

Nov 20 '05 #1
1 916
this technique no longer works with 2005.

what you have to do is create a base class or interface in the app_code dir
that defines a public method to access the literal control. then have the
page inherit and implement this method. the user control can then cast the
page to the base or interface and access the method.

-- bruce (sqlwork.com)

"Dina" <di**@uchicago.edu> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
If anyone could assist me with this issue, I'd really appreciate it!

I have a literal web control, litControl1, in webForm.aspx.
I want to modify the litControl text property from a user control
code-behind page, userControl.ascx.vb.

To do this with VS2003, I had to modify the Web Form Designer Generated
code
from
Protected WithEvents litControl1 As System.Web.UI.WebControls.Literal
to
Public Shared litControl1 As System.Web.UI.WebControls.Literal

and then I could access the property using webForm.litControl1.text =
"whatever"

Since upgrading to VS2005, this code is no longer valid.

Does anyone have any thoughts on any other methods to try???

Thanx in advance!!!
-Dina

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Colin McGuire | last post by:
Hi, I have an report in Microsoft Access and it displays everything in the table. One column called "DECISION" in the table has either 1,2, or 3 in it. On my report it displays 1, 2, or 3. I want...
2
by: Mr Wizard | last post by:
I am going through the front controller http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpatterns/html/ImpFrontControllerInASP.asp and all works well except when the server.transfer...
4
by: Kevin Phifer | last post by:
Ok, before anyone freaks out, I have a solution I need to create that gathers content from maybe different places. Each one can return a <form> in the html, so its the classic can't have more than...
1
by: Dan | last post by:
I have an asp.net page default.aspx with a user control and a placeholder control. <html> <body> <form id="myform" method="post" runat="server" /> <PageHeader:Header id="header1"...
15
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update...
2
by: john | last post by:
Maybe I haven't had that "a-ha" moment yet, but I think the new approach to web projects is a step in the wrong direction. My main beef is that control over the assembly generation process has...
1
by: rushikesh.joshi | last post by:
Hi All, I want some charting functionality in my ASP.NET application. I want to show a multiple bar on my web page. It's based on down time of different servers. like server1: down betn 4 AM...
9
by: Nathan Sokalski | last post by:
I am using ASP.NET 2.0's ImageMap Control to create 2 imagemaps, one directly below the other. When I do this a thin blank space appears between them. After several days of frustration I realized...
4
by: James | last post by:
Hello everyone, While loading a page (http://www.edmonton.ca/portal/server.pt?space=CommunityPage&control=SetCommunity&CommunityID=239) into a webbrowser control I use invokemember on the...
3
by: Cirene | last post by:
When you set the value of a user control in a master page, do you have to reference it differently? Also, do they have to be given different names in the templates? For example, this is what I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.