473,748 Members | 4,030 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Add control to all pages through Global.asax

Hi

Is there a way to add a control to my page through the Global.asax

I would like to place this code in the Session_Start page so its only added
to the first page the user visits.

TIA
Nov 19 '05 #1
4 1680
Create a base page class, that checks for IsNewSession, and adds the
control.

Then have all your pages inherit from this base page.

"Grant Merwitz" <gr***@workshar e.com> wrote in message
news:e4******** ********@TK2MSF TNGP10.phx.gbl. ..
Hi

Is there a way to add a control to my page through the Global.asax

I would like to place this code in the Session_Start page so its only
added to the first page the user visits.

TIA

Nov 19 '05 #2
Thanks, that I have used many times before.
But this particular project was not built with that in mind (not built by me
either)
and there are way too many pages to make those changes

Any other ideas?

"Marina" <so*****@nospam .com> wrote in message
news:eb******** *****@TK2MSFTNG P09.phx.gbl...
Create a base page class, that checks for IsNewSession, and adds the
control.

Then have all your pages inherit from this base page.

"Grant Merwitz" <gr***@workshar e.com> wrote in message
news:e4******** ********@TK2MSF TNGP10.phx.gbl. ..
Hi

Is there a way to add a control to my page through the Global.asax

I would like to place this code in the Session_Start page so its only
added to the first page the user visits.

TIA


Nov 19 '05 #3
I don't think you can do it from Session_Start. It's way too early.

All you would have to do, is change what all the pages inherit from. That's
not so much.

"Grant Merwitz" <gr***@workshar e.com> wrote in message
news:%2******** *******@tk2msft ngp13.phx.gbl.. .
Thanks, that I have used many times before.
But this particular project was not built with that in mind (not built by
me either)
and there are way too many pages to make those changes

Any other ideas?

"Marina" <so*****@nospam .com> wrote in message
news:eb******** *****@TK2MSFTNG P09.phx.gbl...
Create a base page class, that checks for IsNewSession, and adds the
control.

Then have all your pages inherit from this base page.

"Grant Merwitz" <gr***@workshar e.com> wrote in message
news:e4******** ********@TK2MSF TNGP10.phx.gbl. ..
Hi

Is there a way to add a control to my page through the Global.asax

I would like to place this code in the Session_Start page so its only
added to the first page the user visits.

TIA



Nov 19 '05 #4
yeah, just trying to save myself some time.

Thanks anyway

"Marina" <so*****@nospam .com> wrote in message
news:eg******** ******@TK2MSFTN GP14.phx.gbl...
I don't think you can do it from Session_Start. It's way too early.

All you would have to do, is change what all the pages inherit from.
That's not so much.

"Grant Merwitz" <gr***@workshar e.com> wrote in message
news:%2******** *******@tk2msft ngp13.phx.gbl.. .
Thanks, that I have used many times before.
But this particular project was not built with that in mind (not built by
me either)
and there are way too many pages to make those changes

Any other ideas?

"Marina" <so*****@nospam .com> wrote in message
news:eb******** *****@TK2MSFTNG P09.phx.gbl...
Create a base page class, that checks for IsNewSession, and adds the
control.

Then have all your pages inherit from this base page.

"Grant Merwitz" <gr***@workshar e.com> wrote in message
news:e4******** ********@TK2MSF TNGP10.phx.gbl. ..
Hi

Is there a way to add a control to my page through the Global.asax

I would like to place this code in the Session_Start page so its only
added to the first page the user visits.

TIA



Nov 19 '05 #5

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

Similar topics

2
442
by: Ron | last post by:
I need to write a custom textbox control that references an object located in the Global.asax class, but I can't compile the control into a DLL without including the reference to the project DLL that includes the Global.asax assembly. I've tried reflection, but I can't seem to make it work correctly. Does anyone have any ideas how I can make this happen? Thanks,
6
4603
by: José Joye | last post by:
Hello, I'm currently reading the MS Developing Web applications with c# (and VB.net). In the chapter related to Error management, there is a sample about "Page-Level Error Pages" eg: In my form: ========
1
1218
by: JohnH. | last post by:
Hi, Is there a better (best practice) way to do this? I have developed a large set of ASP.NET applications in C#. Like most applications I have a set of utility pages that can be called by applications or directly by users. On my own I have developed a technique to manage the application and lib directories, but it seems a little awkward. I was wondering how other people handle this.
10
1972
by: Daves | last post by:
Is there any way to have a custom server control for all aspx pages which runs code before the page_load event? I need some code to be run before the page_load since it's supposed to change some Page properties, something like an include file in the old classic asp days...
15
4777
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update button will verify the information that has been entered and updates the data base if the data is correct. Update will throw an exception if the data is not validate based on some given rules. I also have a custom error handling page to show the...
11
8374
by: Ron | last post by:
I have a web project compiled with the new "Web Deployment Projects" plugin for VS2005. I'm deploying the web project to one assembly and with updateable option set to ON. When I'm running the generated code on a W2K3 server the application_start and any other event on the global.asax file won't fire. I added tracing and logging to make sure and I can see the code is just not execution. When running the same exact (deployed etc.) code on...
16
5042
by: thefritz_j | last post by:
We just converted our VS2003 1.1 VB web project (which was working fine) to VS2005 2.0 and now I get: Parser Error Message: Could not load type '<Namespace>.'. Source Error: Line 1: <%@ Application Codebehind="Global.asax.vb" Inherits="<Namespace>." %> I've done a lot of things I've found on the web to no avial, but here are some unique things about what is happening to me.
15
2570
by: =?Utf-8?B?UGF0Qg==?= | last post by:
Just starting to move to ASP.NET 2.0 and having trouble with the Global.asax code file. In 1.1 I could have a code behind file for the global.asax file. This allow for shared variables of the Global class. Note: I use these shared variables for read only values that are set at application start. It would appear the 2.0 doesn't like you to use shared variables in the global class. How do I convert my 1.1 applications to 2.0 without...
1
2345
by: daonho | last post by:
Hi Everyone, I have encountered this problem that I am not able to figure out. Please drop me some lines if you have any idea how to solve this issue. I have a global.asax file in my web site. It works fine as I wanted when loading aspx file; however, I have some static page in the same directory such as html and htm page. These page also load correctly and the global.asax file does fire when executing my .net development environment....
0
8991
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8831
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,...
0
9548
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9374
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9325
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,...
1
6796
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
6076
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
4876
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3315
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.