Ask a Question related to ASP.NET Building Controls, Design and Development.
-
Paul Barnett #1
User control newbie question - pls help
I have a user control with a label and a method. The webform should call
the method on the user control and populate the label. I am getting
object not set errors as soon as I try to access the label on the user
control.
A small sample of code would be greatly appreciated.
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Paul Barnett Guest
-
Web User Control question
I have a web user control that I wrote. I'm new to doing this. Doesn't seem like a big deal though. One thing I wonder about, and although maybe... -
User Control Populate Form after Log On - newbie question
Hi, I have a user control that contains a login element, textboxes for username and password, and a button to submit, which appears in the header... -
Page_Load called more than once for user control - newbie question
Hi, I have a page with a user control as header, which in turn has a user control drop down list. When I run the page in debug with a break on... -
Newbie Question: User selected query
I have a datagrid that is populated by a SQL query that is create by the user. Their is a DropDOwnList and a textbox. This gives them the WHERE... -
Newbie Web Service Question regarding User Controls
Can I return a user control from a Web Service? I have a Web Page that has a Placeholder on it and I wish to populate this placeholder with a... -
Travis Bolton #2
Re: User control newbie question - pls help
Nice little "secret" solution to this I believe.
You need to explicitly declare the object variable for your user control,
unlike when you add a normal control and VS does it for you:
Protected WithEvents Control ID As UsercontrolType (where Control ID is the
id of the control after you dragged it onto your web form, and
usercontroltype is the class name)
Hope this helps. Not sure if the WithEvents is required or recommend, might
depend on your implementation
"Paul Barnett" <paul@barnett23.eclipse.co.uk> wrote in message
news:%23v%23WvLGiDHA.1508@TK2MSFTNGP10.phx.gbl...> I have a user control with a label and a method. The webform should call
> the method on the user control and populate the label. I am getting
> object not set errors as soon as I try to access the label on the user
> control.
>
> A small sample of code would be greatly appreciated.
>
>
> *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
> Don't just participate in USENET...get rewarded for it!
Travis Bolton Guest
-
Victor Garcia Aprea [MVP] #3
Re: User control newbie question - pls help
Small note: keep in mind that for the parser to do its magic, you need to
name your member variable *exactly* after the value of the ID attribute
given in your usercontrol tag.
--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Looking for insights on ASP.NET? Read my blog:
[url]http://obies.com/vga/blog.aspx[/url]
To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
and not by private mail.
"Travis Bolton" <travis.bolton@sbcglobal.net> wrote in message
news:OK71g7XmDHA.2364@TK2MSFTNGP11.phx.gbl...the> Nice little "secret" solution to this I believe.
>
> You need to explicitly declare the object variable for your user control,
> unlike when you add a normal control and VS does it for you:
>
> Protected WithEvents Control ID As UsercontrolType (where Control ID ismight> id of the control after you dragged it onto your web form, and
> usercontroltype is the class name)
>
> Hope this helps. Not sure if the WithEvents is required or recommend,> depend on your implementation
>
> "Paul Barnett" <paul@barnett23.eclipse.co.uk> wrote in message
> news:%23v%23WvLGiDHA.1508@TK2MSFTNGP10.phx.gbl...>> > I have a user control with a label and a method. The webform should call
> > the method on the user control and populate the label. I am getting
> > object not set errors as soon as I try to access the label on the user
> > control.
> >
> > A small sample of code would be greatly appreciated.
> >
> >
> > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
> > Don't just participate in USENET...get rewarded for it!
>
Victor Garcia Aprea [MVP] Guest



Reply With Quote

