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

ASP.NET pages compile & run

Hi skilled,

I wonder if anybody knows how the ASP.NET actually does this.
So far I have been assuming the following:
1. aspx pages are compiled in gory-named files (ken0-m7f.0.jsl or
something) under my "Temporary ASP.NET Files" folder.

2. these files contain classes that extend my code-behind ones and
implement System.Web.SessionState.IRequiresSessionState interface in
order to deal with session variables.

3. if I have a read/write property in a custom user control (ahem, I
have a custom control extending System.Web.UI.UserControl),
and if somewhere in my aspx page I have the initialization code

<custom:tag runat="server" foo="zzzz">

so consequently somewhere in this awkward ken0-m7f.0.jsl I would
come across something like

#line 44 "D:\\path\\to\\project\\hithere.aspx"
__ctrl.set_foo("zzzz");

4. It's all OK so far, but when I want the variable to be an object
(for sure changes the type in code) and state

<custom:tag runat="server" foo='<%# new String("ffff") %>'>

5. the set-foo-lines in ken0-m7f.0.jsl are changed to

#line 44 "D:\\path\\to\\project\\hithere.aspx"
__ctrl.add_DataBinding( new
System.EventHandler(this.__DataBind__control8) );
Hummm... I could swear to the appropriate event handler is added to the
control handler list but WHAT should I do to invoke/catch this
delegate?
Maybe a point where to dig through?

Thank you,
Andrew

Mar 9 '06 #1
2 1266
Well... overcome this!
In my custom control I've overloaded two methods:
public Control get_BindingContainer() {
Control container = get_Parent();
try{
//put in try-catch because at first time container is NULL
//though FWIW feel like doing something illegal
container = super.get_BindingContainer();
}
catch(Exception ex) {
String s = ex.getMessage();
s += "\nI am not scared, huh";
}
return container;
}

public void add_DataBinding(System.EventHandler value) {
super.add_DataBinding(value);

// uh oh, this is the magic line:
super.DataBind();
}

and now I can pass object variables from aspx pages

<custom:tag runat="server" foo="<%# new Integer(123) %>">
That's okay, but could anybody explain what actually is happening
behind the scene??
Is there a better the way than I've proposed?

Tia and kind regards,
Andrew

Mar 9 '06 #2
Overcome!

DataBind should have been invoked from Page_Load()... or I guess
control's OnInit is quite ok as well

And a couple of glorious articles:
http://dotnetdan.com/articles/aspnet...Principles.htm
http://dotnetdan.com/articles/aspnet/DataBinding.htm

Mar 10 '06 #3

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

Similar topics

0
by: TheCoder | last post by:
I am making a D-base with web conectivity for my class project. I have everything working but the subit button sends the data to the correct fields but afterwards it wants to reproduce new blank...
6
by: Thomas Connolly | last post by:
I have 2 pages referencing the same codebehind file in my project. Originally the pages referenced separate code behind files. Once I changed the reference to the same file, everything worked...
21
by: matvdl | last post by:
I have a system that was originally developed in asp - the pages are saved in SQL (there are over 10,000 pages) and saved to a temp directory in the server when requested by a client. I have...
2
by: Rob R. Ainscough | last post by:
I'm using forms authentication along with Master pages -- my authenticated forms reside is a sub-dir (Secure) below the web site root dir. The problem is that any graphics placed on the Master...
17
by: MeerkatInFrance | last post by:
There comes a time when you know you are not going to be able to work something out yourself, however hard you try. I have reached that moment. I have a master page and a slave page (or whatever...
1
by: LiveCycle | last post by:
Hi, I'm putting together a project that uses ASP.NET in VS2005. It uses a single master page that is responsible for most of the heavy lifting. About 90% of the 200 pages have the same...
3
by: Morten Snedker | last post by:
On the load part of 6 differint aspx pages I wish to run the same code. Instead of having the same code on 6 pages it would be kind of nice to have it in one place and include/call it. How...
18
by: Luminari | last post by:
I have two pages. Both of them are supposed to have one table on it with a fixed header. Both pages were tested in IE6. Structurally they are identical. Both have a <divthat wraps a <tablethat...
4
by: Choi | last post by:
Good morning. I've tried to extract, using libcurl, web pages but it failed. There is no compilation error concerning the class I wrote, but the problems appear when I compile a main method...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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.