Getting a control linked to a database record - beginners question  
Author Message
Sany





PostPosted: Thu Apr 12 12:15:08 CDT 2007 Top

ASP.Net >> Getting a control linked to a database record - beginners question

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 page more than
once.

I am trying to work out how I'd get each instance of the control to load its
corresponding database record to display the text?

I would normally do this sort of thing via a querystring, but in this case
its not going to be practical.

Could someone give me some hints on how I could get the control to know
which database record it needs without using querystrings?

What I think I need is a unique property value (unique on all pages) for
each control, that I can store in the database record.....??

Help!!

JJ

Web Programming179  
 
 
JJ





PostPosted: Thu Apr 12 12:15:08 CDT 2007 Top

ASP.Net >> Getting a control linked to a database record - beginners question Perhaps if I could make each control id unique throughout the entire site, I
could use that to look up a specific row ?




> 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 page more than
> once.
>
> I am trying to work out how I'd get each instance of the control to load
> its corresponding database record to display the text?
>
> I would normally do this sort of thing via a querystring, but in this case
> its not going to be practical.
>
> Could someone give me some hints on how I could get the control to know
> which database record it needs without using querystrings?
>
> What I think I need is a unique property value (unique on all pages) for
> each control, that I can store in the database record.....??
>
> Help!!
>
> JJ
>


 
 
JJ





PostPosted: Fri Apr 13 03:42:40 CDT 2007 Top

ASP.Net >> Getting a control linked to a database record - beginners question I guess the url combined with the control id would be a unique value. My
concern then is if I allow a user to move the control (web part) to another
part of the page, I assume the control id would change. I'd therefore have
to work some way out of updating this in the record.

Anyone have any suggestions?



> Perhaps if I could make each control id unique throughout the entire site,
> I could use that to look up a specific row ?
>
>


>> 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 page more than
>> once.
>>
>> I am trying to work out how I'd get each instance of the control to load
>> its corresponding database record to display the text?
>>
>> I would normally do this sort of thing via a querystring, but in this
>> case its not going to be practical.
>>
>> Could someone give me some hints on how I could get the control to know
>> which database record it needs without using querystrings?
>>
>> What I think I need is a unique property value (unique on all pages) for
>> each control, that I can store in the database record.....??
>>
>> Help!!
>>
>> JJ
>>
>
>