473,387 Members | 1,575 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,387 software developers and data experts.

Shortening of syntax

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

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

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

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

(Page.Controls.Item(1).Controls.IndexOf(pnl)).Cont rols.IndexOf(frmDict.myformctrls.Item("txtQuantity 1").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)).Cont rols.IndexOf(Page.Controls.Item(1).Controls.Item _

(Page.Controls.Item(1).Controls.IndexOf(pnl)).Cont rols.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
Jul 12 '06 #1
1 1067
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.

"steven scaife" wrote:
Hi is it possible to shorten the syntax of the following.

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

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

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

(Page.Controls.Item(1).Controls.IndexOf(pnl)).Cont rols.IndexOf(frmDict.myformctrls.Item("txtQuantity 1").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)).Cont rols.IndexOf(Page.Controls.Item(1).Controls.Item _

(Page.Controls.Item(1).Controls.IndexOf(pnl)).Cont rols.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
Jul 12 '06 #2

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

Similar topics

2
by: kaptain kernel | last post by:
how does one shorten an array based on a key value. Say I have this: array("Car1"=>"Porsche","Car2"=>"Merc","Car3"=>"Ford","Car4"=>"Toyota"); and I want to pop "Car2" out of the array,...
4
by: Dariusz | last post by:
I have a guestbook on one of my sites where the entires are formatted to be x pixles in width. Now the text is input and output from a "blob" field from a database... but when people input long...
699
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro...
22
by: Tuang | last post by:
I'm checking out Python as a candidate for replacing Perl as my "Swiss Army knife" tool. The longer I can remember the syntax for performing a task, the more likely I am to use it on the spot if...
14
by: Sandy Norton | last post by:
If we are going to be stuck with @decorators for 2.4, then how about using blocks and indentation to elminate repetition and increase readability: Example 1 --------- class Klass: def...
16
by: George Sakkis | last post by:
I'm sure there must have been a past thread about this topic but I don't know how to find it: How about extending the "for <X> in" syntax so that X can include default arguments ? This would be very...
19
by: Nicolas Fleury | last post by:
Hi everyone, I would to know what do you think of this PEP. Any comment welcomed (even about English mistakes). PEP: XXX Title: Specialization Syntax Version: $Revision: 1.10 $...
3
by: Manuel | last post by:
I'm trying to compile glut 3.7.6 (dowbloaded from official site)using devc++. So I've imported the glut32.dsp into devc++, included manually some headers, and start to compile. It return a very...
3
by: vern | last post by:
Just curious, how would I shorten the following code? $sql_forum_posts_num = "SELECT forum_posts FROM ". $db_db.".phpbb_forums WHERE forum_id = '$forum_id'"; $forum_posts_num =...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.