473,387 Members | 1,798 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.

I feel I am stupid

ad
I have 50 web page in my project, there always a DataGrid in every page.

The PreRender event is the same all of the DataGrid
I have copy/paste the code of PreRender many many times.

I think there must be a method instead of copy/paste

How can I reuese the event for all the DataGrids ?

Nov 19 '05 #1
4 1139
Hi ad!

Well, I am feeling extremely stupid at the moment too. You can see my post
at "Help!! RedirectFromLoginPage . . ." just five posts beneath yours. Any
suggestions, please help if you can.

At any rate, I am wondering if you have tried making your datagrid with the
added code into a user control. You can then include that user control in
each page.
--
Sandy
"ad" wrote:
I have 50 web page in my project, there always a DataGrid in every page.

The PreRender event is the same all of the DataGrid
I have copy/paste the code of PreRender many many times.

I think there must be a method instead of copy/paste

How can I reuese the event for all the DataGrids ?

Nov 19 '05 #2
I assume that you are using ASP.Net 1.1

In that case, create a base-page class. Right now, all 50 pages would
be having 50 different classes from which the aspx-pages inherit.

Make a base class, like BasePage. Here's the final hierarchy:
BasePage : System.Web.UI.Page
-- override PreRender (common functionality for DataGrid)

SomePage : BasePage
-- override PreRender (specific to this page. Don't forget to call
base.PreRender)

somePage.aspx inherits "SomePage" (using <%@ Page ... %> directive).
HTH
--
Cheers,
Gaurav Vaish
http://mastergaurav.blogspot.com
http://mastergaurav.org
-------------------

Nov 19 '05 #3
ad
I think you are my GOD!
I trid to test your answer, but fail.
Could you give me a more detail example?
"MasterGaurav" <ga**********@gmail.com>
???????:11**********************@g47g2000cwa.googl egroups.com...
I assume that you are using ASP.Net 1.1

In that case, create a base-page class. Right now, all 50 pages would
be having 50 different classes from which the aspx-pages inherit.

Make a base class, like BasePage. Here's the final hierarchy:
BasePage : System.Web.UI.Page
-- override PreRender (common functionality for DataGrid)

SomePage : BasePage
-- override PreRender (specific to this page. Don't forget to call
base.PreRender)

somePage.aspx inherits "SomePage" (using <%@ Page ... %> directive).
HTH
--
Cheers,
Gaurav Vaish
http://mastergaurav.blogspot.com
http://mastergaurav.org
-------------------

Nov 19 '05 #4
What did you try?

My email is gaurav[dot]vaish @ gmail[dot]com. Send me basic skeleton of
your code (2 aspx pages and their code behind)... I may be able to help
out directly from there....
--
Cheers,
Gaurav Vaish
http://mastergaurav.blogspot.com
http://mastergaurav.org
-------------------

Nov 19 '05 #5

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

Similar topics

8
by: sebb | last post by:
I'm kind of newbie to programming, but I thought of something and I want some opinions on that. It's about a new instruction block to do some cycles. I thought about that because it's not very...
119
by: rhat | last post by:
I heard that beta 2 now makes ASP.NET xhtml compliant. Can anyone shed some light on what this will change and it will break stuff as converting HTML to XHTML pages DO break things. see,...
2
by: Lampa Dario | last post by:
Hi, where is this stupid error in this program? When I execute it, i receive a segmentation fault error. #include <stdio.h> int main(int argc, char *argv, char *env) { int i=0; int l=0; int...
10
by: Fei Li | last post by:
Hi, If I'm not stupid for this, then the design of FolderBrowserDialog is very stupid. It only allow to strat browing from several predefined folder(Environment.SpecialFolder). What can I do if...
2
by: louise raisbeck | last post by:
hi, i am trying to get to a point where i can use intellisense. i have everything else sorted apart from my codebehind. Is it me or does .NET seem really biased towards vb.net? even though i have...
5
by: Guoqi Zheng | last post by:
I think I have this kind of problem very often, now it is really making me crazy. VS.NET always want to change my html code. Ok, that is fine as long as Vs.Net can ask my confirmaton first. For...
20
by: mc | last post by:
I may be opening a can of worms and don't want to start a religious war, but... What features of Java do Java programmers miss when working in C#? Other than, of course, great portability. C#...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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.