Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<%$ %> in the declarative code

Status
Not open for further replies.

seaport

MIS
Jan 5, 2000
923
US
Here is the code generated by visual studio.

<asp:SqlDataSource ID="ds1" runat="server" ConnectionString="<%$ ConnectionStrings:myConnectionString %>"
... >

I think this is how we can access web.config data from declarative code.

Could someone give me a link to the MS documentation on this?

Thanks in advance.


 
have you tried google, msdn, VS help (F1)?

a word of caution. the more you cram into the markup and code behind the more difficult it is to test your application.

datasource controls are the worst option for displaying data on screen unless you simply want to slap the data directly into the html. there is no way to intercept the data between the query and html. this will be a problem if you want to preform any logic on the data before displaying or saving changes back to the database.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
I tried but could not find anything. I think I was not using the right keyword, like "declarative code" versus "vb code". Is it how we call them?

I agree that the data source control does not give us total control on the data process. When I debug, I usually use SQL Profiler. I use data source control if I have to implement some pages fast.

If I do not use data source control, I have to code each data process (read/write) in the event of the data bound control (like the updating event of a gridview). Is that how you do it?

 
1. I don't use webforms (front page controller and html rendering engine) so there is no concept of data binding, postback, viewstate, etc.
I use Monorail (MVC framework) with the Spark view engine (html rendering engine).
2. I use NHibernate to map my domain objects to the database.
3. I reduce repetitive code by utilizing common design patterns and the SOLID design principles.

take a look at my FAQ on connection management to get an idea of reducing duplicate code and keeping a higher level of maintainability.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top