|
<!--#include file="myfile.aspx"-->
I wouldn't advise you to use includes though. They were useful in the days of classic ASP as a means of reusing script code. However the object-orientated nature of .NET means there are more sophisticated means of reusing code e.g. Master Pages, User Controls etc. Anyway, database connection details should be stored in your web.config file. There is a specific <connectionstrings/> section for them.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Your database code should be in a class, or in a dll. It sure should not be included with .inc files.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi All,
I struck against the meaning of user control. Please i need your comments for this issue
As per my knowledge we use user control when there is reusable logic and UI present in the web application.
But here I am allocated to a new project where they are using one user control for each page just to simplify the amount of logic that is on the page.
Means they have almost n number of user controls for n number of pages. Is it proper way? Do we need to have concern for performance issue
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
If you are using ASP.NET 1x, the answer is Yes. It should not be defined to have one user control for one page. There might be some pages that share the same user control. And also, there might be some pages that have more than one user control.
playing with bugs ) wrote: As per my knowledge we use user control when there is reusable logic and UI present in the web application.
plus, the reason why we used to use the user control is that we want to create the basepage for website themes.
|
|
|
|
|
Michael,
Thanks for giving your comments
Michael Sync wrote: If you are using ASP.NET 1x, the answer is Yes.
I am using ASP.NET 2.0. What makes the difference between 2 ?
Michael Sync wrote: plus, the reason why we used to use the user control is that we want to create the basepage for website themes.
We can use master page for this.
So what should we conclude ?
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
playing with bugs ) wrote: I am using ASP.NET 2.0. What makes the difference between 2 ?
If you are using ASP.NET 2.0, one user control for one page won't be needed for you anymore.
For performance, I don't think that there is any differences between the page and user control..
|
|
|
|
|
Michael
but if i would have using ASP.NET 1.x then why i can use one user control for 1 page ? Means what makes this difference in 2.0 ..
i don't know my question is making any sense or not ?
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
When we were using ASP.NET 1x, there is no build-in master page. So, we had to create the base class for that and added the user control dynamically to the page.. but when we moved to ASP.NET 2.0, we don't need that concept anymore..
|
|
|
|
|
Hmm
Thanks Buddy
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
playing with bugs ) wrote: As per my knowledge we use user control when there is reusable logic and UI present in the web application.
Are you speaking about ascx files ? I think master pages are a good replacement for this.
playing with bugs ) wrote: But here I am allocated to a new project where they are using one user control for each page just to simplify the amount of logic that is on the page.
I don't find any problem in in this design. There might be some reason that they chose this method. May be the user controls was developed by one programmer, and ASPX pages are done by other. So the person who created ASPX pages, don't need to understand what's happening inside the user control. I think it's for easy maintainability.
You need to identify, why they used such a method. I don't think that it will make performance problems.
|
|
|
|
|
Navaneeth,
thanks for your comments
N a v a n e e t h wrote: Are you speaking about ascx files ?
Yes i am saying ASCX files.
N a v a n e e t h wrote: I think it's for easy maintainability
That's what i wanted (specific answer)
What will you say to this sentence.Please give your comments
The user controls are used to simplify the amount of logic that is on the page
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
playing with bugs ) wrote: The user controls are used to simplify the amount of logic that is on the page
Well, I think when you use user controls, your logic is not getting simplified. But your code is getting simplified and gives easy readability. Commonly used things can be put in one centralized place.
|
|
|
|
|
Well then here my question came again as you said
N a v a n e e t h wrote: Commonly used things can be put in one centralized place
But that user control is going to use by one page and that also single time so there could not be any common things.It contains logic for populating the page(UI) and getting data from UI to data container
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
No idea exactly why the used this method. May be it's their style of coding. But I am sure that it won't make any performance difference.
|
|
|
|
|
OK Navaneeth
Thank you very much for your valuable comments
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
I have a GridView on a page, and I know some of the properties I want to show at design time, but the rest I only know at run-time. So I'm thinking of binding to an ObjectDataSource for the properties I know at design time, and declaratively add the needed BoundFields to the GridView (then I can also use paging).
For the stuff I only know at run-time I'm thinking of adding the columns at the page's InitializeComponent(), and adding the data itself at the GridView's RowDataBound event.
Is this possible? Any good ideas, comments?
"When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
-Atlas Shrugged, Ayn Rand
|
|
|
|
|
iam sending a null value to the stored procedure .how i can check in if loop of the stored procedure wheter the send value is null or something
|
|
|
|
|
IF @Value IS NULL
-- print 'This is null value'
ElSE
-- print 'Some Value'
|
|
|
|
|
can write is not null if value is there
|
|
|
|
|
|
Hi all,
I want to strip html tags from a string ,but only opening tags only.
for eg
<td>111</td>
<td>112</td>
<td>113</td>
<td>114</td>
i need this because later i want to replace "" by "|" so as to format it like 111 | 112 | 113 | 114
any help would be appreciated
thanks in adv
modified on Wednesday, December 12, 2007 3:01:45 AM
|
|
|
|
|
hi
I have to add nodes and subnodes to a tree view from sql database in asp.net 2.0 with c#.
Gayatri
|
|
|
|
|
use treeview control then select datasource .....
Rajendran.AL
|
|
|
|
|
pls give me a details code
Gayatri
|
|
|
|
|
Please use Google for the details code. You know how to use Google, right?
|
|
|
|