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

control id's - beginners question

JJ
I have a control that can be placed on any page 1 or more times (like a web
part).

The control loads text from database tables. Its the first time I've done
this so I just need a pointer to solve a very simple problem:

How do I tell the control which record to get the text from in the database?
e.g.. I could use a querystring - but that could get lengthy if there are
several controls doing the same thing on the one page.

My thought was to perhaps tie the control ID to the database record - i.e.
have a row for 'controlID' in each record, so all I have to do on load would
be to search for that controls 'id'. Is that the correct approach here?

My concern would be if that control's id property is autogenerated, and if
it would change if, for example, the control was moved to another area of
the page?

Any pointers greatfully received!

JJ
Apr 12 '07 #1
2 1106
JJ
the control id would not be unique across all pages so I guess I'd have to
somehow generate it via the SQL database?
"JJ" <ab*@xyz.comwrote in message
news:uk**************@TK2MSFTNGP06.phx.gbl...
>I have a control that can be placed on any page 1 or more times (like a web
part).

The control loads text from database tables. Its the first time I've done
this so I just need a pointer to solve a very simple problem:

How do I tell the control which record to get the text from in the
database? e.g.. I could use a querystring - but that could get lengthy if
there are several controls doing the same thing on the one page.

My thought was to perhaps tie the control ID to the database record - i.e.
have a row for 'controlID' in each record, so all I have to do on load
would be to search for that controls 'id'. Is that the correct approach
here?

My concern would be if that control's id property is autogenerated, and if
it would change if, for example, the control was moved to another area of
the page?

Any pointers greatfully received!

JJ

Apr 12 '07 #2
JJ
Scrap that question - I just add a 'txtrecordID' property to the control.

I'll get the hang of this asp.net one day....
"JJ" <ab*@xyz.comwrote in message
news:uk**************@TK2MSFTNGP06.phx.gbl...
>I have a control that can be placed on any page 1 or more times (like a web
part).

The control loads text from database tables. Its the first time I've done
this so I just need a pointer to solve a very simple problem:

How do I tell the control which record to get the text from in the
database? e.g.. I could use a querystring - but that could get lengthy if
there are several controls doing the same thing on the one page.

My thought was to perhaps tie the control ID to the database record - i.e.
have a row for 'controlID' in each record, so all I have to do on load
would be to search for that controls 'id'. Is that the correct approach
here?

My concern would be if that control's id property is autogenerated, and if
it would change if, for example, the control was moved to another area of
the page?

Any pointers greatfully received!

JJ

Apr 12 '07 #3

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

Similar topics

3
by: vikenk | last post by:
Hello, This is my first post to this group. A little background first: I'm not not new to web-design, but new to manual coding :>) I'm trying to move from total dependence on FrontPage to more...
5
by: serge calderara | last post by:
Dear all, I am new in asp.net and prepare myself for exam I still have dificulties to understand the difference between server control and HTML control. Okey things whcih are clear are the fact...
7
by: | last post by:
Hello, Does anyone have an idea on how I can filter the data in the gridview control that was returned by an sql query? I have a gridview that works fine when I populate it with data. Now I...
1
by: Mark Olbert | last post by:
I have a "master" composite control which, in turn, holds an instance of a "detail" composite control (the "master" control will ultimately contain multiple instances of the "detail" control, but...
4
by: Boris Yeltsin | last post by:
OK, on my Master Page I have a control: <a id="hypTabAccount" href="#" runat="server">Account</a> Now, in the code-behind (Root.master.vb) I can refer to it simply thus: ...
1
by: Alec MacLean | last post by:
Hi, Outline of problem: I've built a set of user controls that are used to output questions for a survey and gather the responses using simple radio buttons. I'm adding an optional textbox...
2
by: JJ | last post by:
OK - I asked this earlier but thought I'd solved it. Clearly not. I have a control that I need to display text from an sql database. The control is being used as a web part so can be placed on a...
2
by: Ken Fine | last post by:
I want to add the security question and answer security feature to the ChangePassword control. I am aware that this functionality is built into the PasswordRecovery tool. I have implemented the...
4
by: =?Utf-8?B?UmljaEI=?= | last post by:
I am trying to create a project using the ASP.NET AJAX accordion control. I would like to dynamically add panes to the control with a form template added when the pane is added. I have tried...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...

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.