473,790 Members | 2,850 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Question regarding code behind mode.

Hi all,

I am new to asp.net. I have one question regarding code- behind model.

I have written page_load event in code behind as well as in aspx page.

Means i am doing mixing of code-behind as well as single file model.
Is it possible to write some code in code behind and some in aspx page
itself.

what i observerd is page_load event which is there in code-behind gets
exeucted. But page_load event present in aspx page is not executed.

Can any one tell me whether it is possible or not.

Please correct me if i am wrong.

thanks in advance.

Mar 8 '07 #1
1 1243
Hi,

It doesnt make any difference whether you write code in aspx file or in
aspx.vb. When you write code in aspx, at runtime server will seperate that
server side code from aspx. if you write code in code behind file you must
specify it in page directive of aspx file otherwise server will look for the
code written on same aspx file. so you cannot write code in both aspx &
aspx.vb file

Regards
Chetan Chaphekar


"archana" wrote:
Hi all,

I am new to asp.net. I have one question regarding code- behind model.

I have written page_load event in code behind as well as in aspx page.

Means i am doing mixing of code-behind as well as single file model.
Is it possible to write some code in code behind and some in aspx page
itself.

what i observerd is page_load event which is there in code-behind gets
exeucted. But page_load event present in aspx page is not executed.

Can any one tell me whether it is possible or not.

Please correct me if i am wrong.

thanks in advance.

Mar 8 '07 #2

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

Similar topics

4
2168
by: 0to60 | last post by:
I have a question about socket programming in general. Exactly what happens behind the scenes when I one socket connects to a different socket in listen mode? Using the dotnet framework, I create a socket, bind it to a port, put it in listen mode, and then n sockets can connect to it. The code: Socket newSocket = listeningSocket.Accept(); returns a socket. I can communicate on newSocket, and listeningSocket goes
3
1480
by: Andrew Jocelyn | last post by:
Hi I have a simple ASP.NET web page with a single label control: <%@ Page Language="vb" AutoEventWireup="false" Codebehind="default.aspx.vb" Inherits="proj.TheTime" EnableViewState="false" EnableSessionState="false"%> .... <p> <asp:label id="Label1" runat="server">Label</asp:label></p> ....
3
1404
by: Prince | last post by:
I have strange problem. If in Design Mode and I drag a Web Server Control onto the form, Visual Studio automatically declares the control for me in the code behind page. However, if I'm working in HTML mode and I manually enter the the Web Server Control, nothing is written in the code behind page. If I declare the control myself and attempt to use it, I get an error stating something like, "ojbect not ininialize".
1
1302
by: Julien Lefebvre | last post by:
Hello all, When we add a new component in default.aspx in the designer mode, it automitically adds a line declairing the component in the codebehind. We dont want the declaration of this component in the code behind because we inherit from a base class which already contain this declaration of the component. For example, we need a "TopMenu" component in all pages so we declared it in the Base Class. The base class will fill this menu......
1
1423
by: mac | last post by:
Hi, I dont have sql 2005 express on my machine. Instead i have sql server 2005 CTP. When i build and run the website, i get following error. What are necessory steps required to run site. Server Error in '/WebSite3' Application -------------------------------------------------------------------------------- Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
5
1046
by: Brian | last post by:
Hello, I was just playing around with Visual Web Developer 2005 Express (still using Web Matrix) and I added a few controls but I can't seem to code the controls when I double click on one (I.E. the subroutine for a button). Is that gone from ASP 2.0 or do I need to adjust the settings? Thanks, Brian
42
6828
by: mellyshum123 | last post by:
I need to read in a comma separated file, and for this I was going to use fgets. I was reading about it at http://www.cplusplus.com/ref/ and I noticed that the document said: "Reads characters from stream and stores them in string until (num -1) characters have been read or a newline or EOF character is reached, whichever comes first." My question is that if it stops at a new line character (LF?) then how does one read a file with...
2
1389
by: stamyo | last post by:
Hello to everyone, i'm facing the following problem: I have a form which is used for both insert or update data.. The situation is like that: when the user fills the form, press the submit button and an error (regarding the validation of data) occurs (e.g. he puts letters instead of numbers), the form sends him to a page in order to see what was wrong and a "back" button appears. Now, when he is in an 'update mode' and press 'back' the form...
8
1707
by: Goran | last post by:
Hi all, I have a question regarding operator <<. A lib of mine contains a class with an overloaded operator << as NON- class member. This would look like: #include <iostream> #include <libsomelib.h>
0
9512
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10145
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9986
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9021
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7530
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5422
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3707
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.