Shortening of syntax

G

Guest

Hi is it possible to shorten the syntax of the following.

Ctype(Page.Controls.Item(1).Controls.Item(Page.Controls.Item(1).Controls.IndexOf(pnl)).Controls.Item(Page.Controls.Item(1).Controls.Item _

(Page.Controls.Item(1).Controls.IndexOf(pnl)).Controls.IndexOf(Page.Controls.Item(1).Controls.Item _

(Page.Controls.Item(1).Controls.IndexOf(pnl)).Controls.Item(Page.Controls.Item(1).Controls.Item _

(Page.Controls.Item(1).Controls.IndexOf(pnl)).Controls.IndexOf(frmDict.myformctrls.Item("txtQuantity1").txtCont)))), HtmlInputText).Value

I dont want to keep cutting and pasting that, surely i can shorten it. I
have tried

with
Page.Controls.Item(1).Controls.Item(Page.Controls.Item(1).Controls.IndexOf(pnl)).Controls.Item(Page.Controls.Item(1).Controls.Item _

(Page.Controls.Item(1).Controls.IndexOf(pnl)).Controls.IndexOf(Page.Controls.Item(1).Controls.Item _

(Page.Controls.Item(1).Controls.IndexOf(pnl)).Controls.Item(Page.Controls.Item(1).Controls.Item _
(Page.Controls.Item(1).Controls.IndexOf(pnl))

But i get the error value of type 'system.web.ui.control' cannot be
converted to integer.

TIA
 
G

Guest

nevermind i found an alternative approach. I can just modify my object in
the sub routine in the class and set the properties in the page when
processing returns.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top