Ask a Question related to ASP.NET General, Design and Development.
-
trinitypete #1
HTML Controls and User controls
I have a user control that is basically a login dialogue.
If I add the user control to webpage1, can I access the
properties directly from C# codebehind, or do I have to
access the properties from HTML behind webpage1.
Thanks in advance. Pete
trinitypete Guest
-
communication between an application, custom controls, and user controls
Hi, and many thanks in advance... I'm a little lost about how to proceed with communication between an application, custom controls, and user... -
Why the properties of web user controls which inherted from my custom base UI controls MISSED?
Why the properties of web user controls which inherted from my custom base UI controls MISSED? How should I to set enable? -
using javascript in User controls to access server controls of the user control
Hello all, I have an asp.net textbox (named txtHidden) and an HtmlButton(named btnAction). I wanted to write a javascript function which will get... -
user controls: dynamiclly added child controls dont survive post back ?
hi, i have some strange behaviour: i've created a web user control that add's some child controls (e.g: textbox, image buttons) to its control... -
howto access controls in User Controls
"Derda" <safsar@luckyeye.com> wrote in news:e02BoShcDHA.1872 @TK2MSFTNGP12.phx.gbl: From the client bowser? You can't. -- Lucas Tam... -
trinitypete #2
Re: HTML Controls and User controls
Webpage1 is a standard ASP.NET webform which contains the
user control. I know I can access properties of the user
control via the HTML of webpage1 i.e.
<uc1:LoginUserControl id="LoginUserControl1"
property1="Hello" property2="Goodbye"
runat="server"></uc1:LoginUserControl>
but is it possible to access the properties from webpage1
code behind page.
Hope this is a little clearer.
Pete.
dialogue.>-----Original Message-----
>What exactly is "webpage1?"
>
>HTH,
>
>Kevin Spencer
>Microsoft FrontPage MVP
>Internet Developer
>[url]http://www.takempis.com[/url]
>Big things are made up of
>lots of Little things.
>
>"trinitypete" <support@trinity.com> wrote in message
>news:0a9501c33b1f$732d7610$a601280a@phx.gbl...>> I have a user control that is basically a login>>> If I add the user control to webpage1, can I access the
>> properties directly from C# codebehind, or do I have to
>> access the properties from HTML behind webpage1.
>>
>> Thanks in advance. Pete
>
>.
>trinitypete Guest
-
Ryan Fiorini #3
Re: HTML Controls and User controls
Yes It is possible. Here is the code to do it.
Dim _myControl As Control = Page.FindControl("UserControlName")
Dim _myControlType As Type = _myControl.GetType()
Dim _myControl_Property As PropertyInfo =
_myControlType.GetProperty("PROPERTYNAME")
sTemp = _myControl_Property.GetValue(_myControl, Nothing)
Hope this helps.
Ryan
"trinitypete" <support@trinity.com> wrote in message
news:0c6201c33b29$2351b0c0$a401280a@phx.gbl...> Webpage1 is a standard ASP.NET webform which contains the
> user control. I know I can access properties of the user
> control via the HTML of webpage1 i.e.
> <uc1:LoginUserControl id="LoginUserControl1"
> property1="Hello" property2="Goodbye"
> runat="server"></uc1:LoginUserControl>
>
> but is it possible to access the properties from webpage1
> code behind page.
>
> Hope this is a little clearer.
> Pete.
>> dialogue.> >-----Original Message-----
> >What exactly is "webpage1?"
> >
> >HTH,
> >
> >Kevin Spencer
> >Microsoft FrontPage MVP
> >Internet Developer
> >[url]http://www.takempis.com[/url]
> >Big things are made up of
> >lots of Little things.
> >
> >"trinitypete" <support@trinity.com> wrote in message
> >news:0a9501c33b1f$732d7610$a601280a@phx.gbl...> >> I have a user control that is basically a login> >> >> If I add the user control to webpage1, can I access the
> >> properties directly from C# codebehind, or do I have to
> >> access the properties from HTML behind webpage1.
> >>
> >> Thanks in advance. Pete
> >
> >.
> >
Ryan Fiorini Guest
-
trinitypete #4
Re: HTML Controls and User controls
It worked a treat - Thanks.
("UserControlName")>-----Original Message-----
>Yes It is possible. Here is the code to do it.
>
> Dim _myControl As Control = Page.FindControl_myControl.GetType()> Dim _myControlType As Type =(_myControl, Nothing)> Dim _myControl_Property As PropertyInfo =
>_myControlType.GetProperty("PROPERTYNAME")
>
> sTemp = _myControl_Property.GetValuethe>
>
>Hope this helps.
>
>Ryan
>
>
>"trinitypete" <support@trinity.com> wrote in message
>news:0c6201c33b29$2351b0c0$a401280a@phx.gbl...>> Webpage1 is a standard ASP.NET webform which containswebpage1>> user control. I know I can access properties of the user
>> control via the HTML of webpage1 i.e.
>> <uc1:LoginUserControl id="LoginUserControl1"
>> property1="Hello" property2="Goodbye"
>> runat="server"></uc1:LoginUserControl>
>>
>> but is it possible to access the properties fromthe>> code behind page.
>>
>> Hope this is a little clearer.
>> Pete.
>>>> dialogue.>> >-----Original Message-----
>> >What exactly is "webpage1?"
>> >
>> >HTH,
>> >
>> >Kevin Spencer
>> >Microsoft FrontPage MVP
>> >Internet Developer
>> >[url]http://www.takempis.com[/url]
>> >Big things are made up of
>> >lots of Little things.
>> >
>> >"trinitypete" <support@trinity.com> wrote in message
>> >news:0a9501c33b1f$732d7610$a601280a@phx.gbl...
>> >> I have a user control that is basically a login>> >> If I add the user control to webpage1, can I accessto>> >> properties directly from C# codebehind, or do I have>>> >> access the properties from HTML behind webpage1.
>> >>
>> >> Thanks in advance. Pete
>> >
>> >
>> >.
>> >
>
>.
>trinitypete Guest
-
Kevin Spencer #5
Re: HTML Controls and User controls
Your CodeBehind Page should have a reference to the control if you used the
tag you mentioned in your reply. You can therefore access the properties of
the object in your CodeBehind (using its' ID) without any problem.
HTH,
Kevin Spencer
Microsoft FrontPage MVP
Internet Developer
[url]http://www.takempis.com[/url]
Big things are made up of
lots of Little things.
"trinitypete" <support@trinity.com> wrote in message
news:0c6201c33b29$2351b0c0$a401280a@phx.gbl...> Webpage1 is a standard ASP.NET webform which contains the
> user control. I know I can access properties of the user
> control via the HTML of webpage1 i.e.
> <uc1:LoginUserControl id="LoginUserControl1"
> property1="Hello" property2="Goodbye"
> runat="server"></uc1:LoginUserControl>
>
> but is it possible to access the properties from webpage1
> code behind page.
>
> Hope this is a little clearer.
> Pete.
>> dialogue.> >-----Original Message-----
> >What exactly is "webpage1?"
> >
> >HTH,
> >
> >Kevin Spencer
> >Microsoft FrontPage MVP
> >Internet Developer
> >[url]http://www.takempis.com[/url]
> >Big things are made up of
> >lots of Little things.
> >
> >"trinitypete" <support@trinity.com> wrote in message
> >news:0a9501c33b1f$732d7610$a601280a@phx.gbl...> >> I have a user control that is basically a login> >> >> If I add the user control to webpage1, can I access the
> >> properties directly from C# codebehind, or do I have to
> >> access the properties from HTML behind webpage1.
> >>
> >> Thanks in advance. Pete
> >
> >.
> >
Kevin Spencer Guest
-
Kevin Spencer #6
Re: HTML Controls and User controls
Sorry trinitypete,
I misunderstood your question, and neglected to observe that you were
talking about a User Control instead of a Server Control. Handling the User
Control from your CodeBehind is a bit trickier than a Server Control. The
following MSDN article should help:
[url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconexposingpageletproperties.asp[/url]
HTH,
Kevin Spencer
Microsoft FrontPage MVP
Internet Developer
[url]http://www.takempis.com[/url]
Big things are made up of
lots of Little things.
"trinitypete" <support@trinity.com> wrote in message
news:017901c33b31$40806b20$a101280a@phx.gbl...> Kevin,
>
> Now I am intrigued. The HTML used in the webpage1 has the
> tags etc as follows:
>
> <%@ Register TagPrefix="uc1" TagName="LoginUserControl"
> Src="LoginUserControl.ascx" %>
> <uc1:LoginUserControl id="LoginUserControl1"
> runat="server"></uc1:LoginUserControl>
>
> I tried to access the control using LoginUserControl1 but
> intellisense didn't pick it up. I cant find any references
> to the control in webpage1 code behind? Does the Tagprefix
> come into it at all - ie is it a namespace issue?
>
> I have tried recreating the project from scratch but there
> is still no reference in webpage1 code behind?
>> control if you used the> >-----Original Message-----
> >Your CodeBehind Page should have a reference to the> the properties of> >tag you mentioned in your reply. You can therefore access> problem.> >the object in your CodeBehind (using its' ID) without any> the> >
> >HTH,
> >
> >Kevin Spencer
> >Microsoft FrontPage MVP
> >Internet Developer
> >[url]http://www.takempis.com[/url]
> >Big things are made up of
> >lots of Little things.
> >
> >"trinitypete" <support@trinity.com> wrote in message
> >news:0c6201c33b29$2351b0c0$a401280a@phx.gbl...> >> Webpage1 is a standard ASP.NET webform which contains> webpage1> >> user control. I know I can access properties of the user
> >> control via the HTML of webpage1 i.e.
> >> <uc1:LoginUserControl id="LoginUserControl1"
> >> property1="Hello" property2="Goodbye"
> >> runat="server"></uc1:LoginUserControl>
> >>
> >> but is it possible to access the properties from> the> >> code behind page.
> >>
> >> Hope this is a little clearer.
> >> Pete.
> >>
> >> >-----Original Message-----
> >> >What exactly is "webpage1?"
> >> >
> >> >HTH,
> >> >
> >> >Kevin Spencer
> >> >Microsoft FrontPage MVP
> >> >Internet Developer
> >> >[url]http://www.takempis.com[/url]
> >> >Big things are made up of
> >> >lots of Little things.
> >> >
> >> >"trinitypete" <support@trinity.com> wrote in message
> >> >news:0a9501c33b1f$732d7610$a601280a@phx.gbl...
> >> >> I have a user control that is basically a login
> >> dialogue.
> >> >> If I add the user control to webpage1, can I access> to> >> >> properties directly from C# codebehind, or do I have> >> >> >> access the properties from HTML behind webpage1.
> >> >>
> >> >> Thanks in advance. Pete
> >> >
> >> >
> >> >.
> >> >
> >
> >.
> >
Kevin Spencer Guest
-
trinitypete #7
Re: HTML Controls and User controls
Thanks Kevin,
Will research link.
that you were>-----Original Message-----
>Sorry trinitypete,
>
>I misunderstood your question, and neglected to observeHandling the User>talking about a User Control instead of a Server Control.Server Control. The>Control from your CodeBehind is a bit trickier than aurl=/library/en->following MSDN article should help:
>
>[url]http://msdn.microsoft.com/library/default.asp?[/url]
us/cpguide/html/cpconexposingpageletproperties.aspthe>
>HTH,
>
>Kevin Spencer
>Microsoft FrontPage MVP
>Internet Developer
>[url]http://www.takempis.com[/url]
>Big things are made up of
>lots of Little things.
>
>"trinitypete" <support@trinity.com> wrote in message
>news:017901c33b31$40806b20$a101280a@phx.gbl...>> Kevin,
>>
>> Now I am intrigued. The HTML used in the webpage1 hasbut>> tags etc as follows:
>>
>> <%@ Register TagPrefix="uc1" TagName="LoginUserControl"
>> Src="LoginUserControl.ascx" %>
>> <uc1:LoginUserControl id="LoginUserControl1"
>> runat="server"></uc1:LoginUserControl>
>>
>> I tried to access the control using LoginUserControl1references>> intellisense didn't pick it up. I cant find anyTagprefix>> to the control in webpage1 code behind? Does thethere>> come into it at all - ie is it a namespace issue?
>>
>> I have tried recreating the project from scratch butaccess>> is still no reference in webpage1 code behind?
>>>> control if you used the>> >-----Original Message-----
>> >Your CodeBehind Page should have a reference to the>> >tag you mentioned in your reply. You can thereforeany>> the properties of>> >the object in your CodeBehind (using its' ID) withoutuser>> problem.>> the>> >
>> >HTH,
>> >
>> >Kevin Spencer
>> >Microsoft FrontPage MVP
>> >Internet Developer
>> >[url]http://www.takempis.com[/url]
>> >Big things are made up of
>> >lots of Little things.
>> >
>> >"trinitypete" <support@trinity.com> wrote in message
>> >news:0c6201c33b29$2351b0c0$a401280a@phx.gbl...
>> >> Webpage1 is a standard ASP.NET webform which contains>> >> user control. I know I can access properties of theaccess>> webpage1>> >> control via the HTML of webpage1 i.e.
>> >> <uc1:LoginUserControl id="LoginUserControl1"
>> >> property1="Hello" property2="Goodbye"
>> >> runat="server"></uc1:LoginUserControl>
>> >>
>> >> but is it possible to access the properties from>> >> code behind page.
>> >>
>> >> Hope this is a little clearer.
>> >> Pete.
>> >>
>> >> >-----Original Message-----
>> >> >What exactly is "webpage1?"
>> >> >
>> >> >HTH,
>> >> >
>> >> >Kevin Spencer
>> >> >Microsoft FrontPage MVP
>> >> >Internet Developer
>> >> >[url]http://www.takempis.com[/url]
>> >> >Big things are made up of
>> >> >lots of Little things.
>> >> >
>> >> >"trinitypete" <support@trinity.com> wrote in message
>> >> >news:0a9501c33b1f$732d7610$a601280a@phx.gbl...
>> >> >> I have a user control that is basically a login
>> >> dialogue.
>> >> >> If I add the user control to webpage1, can Ihave>> the>> >> >> properties directly from C# codebehind, or do I>>> to>> >> >> access the properties from HTML behind webpage1.
>> >> >>
>> >> >> Thanks in advance. Pete
>> >> >
>> >> >
>> >> >.
>> >> >
>> >
>> >
>> >.
>> >
>
>.
>trinitypete Guest



Reply With Quote

